Instead of the loadRequest: UIWebview method, I load the contents of the UIWebview using a java script for faster loading. There is only one webview in my application, and the contents of the webview will change depending on the choice in the table view. There is also zoom support for browsing the web. Now the problem I am facing is to change the scaling factor to the default when changing the selection of the table view.
Example. Suppose that I am viewing content for some selection in a table format, and I will pinch the zoom, and the zoom ratio is set to a maximum value of 5.0. Now, if I change the selection in the table view, I want the content to load using the default zoom factor i, e 1.0.
I tried using the java script code that I found on the net. Please see the code below.
meta name = \ "viewport \" content = \ "width = device-width; initial-scale = 1.0; minimum-scale = 1.0 maximum-scale = 5.0; \"
Unfortunately, the scaling factor is not reset using this code. But I can set the maximum scale factor for UIWebview. Please let me if anyone knows a solution for this.
[PS: If we use the UIWebview loadRequest: method and set the scalesPageToFit property to YES, then UIWebView itself handles this problem]
source share