Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set a default zoom in a WKWebView

Tags:

ios

swift

webkit

I have a WKWebView setup to display contents of a CSV file. It works fine but the content is zoomed out a lot requiring the user to zoom in.

Is there a way to set a default zoom in a WKWebView? So that when its displayed, the content is already zoomed in an x amount?

I already tried setting a minimumZoomScale on the webview's scrollview but it doesn't seem to do anything.

like image 516
Arjun Avatar asked Jan 25 '26 23:01

Arjun


1 Answers

Did you set the zoomScale to your scrollView then? webView.scrollView.zoomScale = 'your default'

It won't work if you only set the minimumZoomScale.

like image 130
Canh Tran Avatar answered Jan 28 '26 15:01

Canh Tran



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!