UIWebView Does Not Correctly Resize It’s Contents After Rotation

If you use UIWebView to display something on iPad® with landscape and portrait orientation enabled on your application, you should have been noticed that UIWebView does not resize its contents size correctly on some situation.

Indeed it is exactly when you try to first display your content on landscape mode and then turn your device to portrait orientation. Other alternative, displaying content in portrait orientation and then turning into landscape orientation works alright.

What causes this will be out of the scope of this post ı guess so I cut to the case and give you the solution. The solution is adding this line:

<meta name=”viewport” content=”width=device-width” />

to you HTML file and it will hopefully will be resolved. For you who is not using UIWebView in device wide frame, you should really consider following the links for more information.

I have found original informative article here and following the link in that I got better information here.

iPad is a trademark of Apple Inc., registered in the U.S. and other countries.