I had an interesting problem with UIWebView.
Basically, I want to use UiWebView for an iPad application as a modal popup to show mobile pages with wikipedia or amazon if a user performs certain actions.
I have code for creating and loading a UIWebView work file, but the uploaded content does not pay attention to the width of the UIWebView. I wanted the UIWebView (approximately) to be the width of the iPhone screen and set the frame accordingly.
However, when downloading content, it appears that it loads in the width and height of the iPad screen, so it scrolls both horizontally and vertically. Vertical scrolling is OK, but horizontal scrolling is not.
When the same URLs are uploaded to the iPhone (safari only), does the content size change according to the width of the device, which I assume uses a meta tag?
The question is how can I reproduce this behavior in the UIWebView on the iPad and βforceβ the content to the specified width.
Update
Sorry, this is a duplicate of the answer to the UIWebView question - load an external website, programmatically set the initial scale of scale and allow the user to zoom
This solution is smart and works.
source
share