Slavik
Slavik

Reputation: 1083

How to disable UIWebView resize content when resize the UIWebView frame

I have to resize the UIWebView. However the procedure turns to be very slow when the content in the UIWebView is complex. The UIWebView resize its content to fit the new size. I want to disable the resize function to speed up the procedure.

The scalesPageToFit property doesn't work after the content is loaded. It could only affect the loading progress.

I found the UIWebView will not resize content after user manually scale the page. Is that mean there is some trick to disable the resize?

Upvotes: 0

Views: 3007

Answers (1)

Ludovic Landry
Ludovic Landry

Reputation: 11774

I don't think that it is possible with the UIWebView, but if you can modify your HTML, it is possible set the page size and scale with the following line. (Apple special meta tag)

<meta content=”width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;”/>

Upvotes: 3

Related Questions