Question

I've a web application for iphone/ipad. When I view it in mobile safari it appears good both in landscape and portrait mode. But when I open it in my own ipad web app (under uiwebview), it appears good in landscape mode, but contents are cut-off in portrait mode.

How to fix it. Am i supposed to fix it on server side, or in ipad application?

Regards

Was it helpful?

Solution

If it works in Mobile Safari and not in your wrapper app using UIWebView, it is possible that the problem comes from the application, and that your webview is not properly resized when the device rotates to landscape. Try setting the webview's autoresizingMask as follow in your view setup code :

webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

or, if you defined your webview in Interface Builder, use the "size inspector" to set the appropriate autoresizing mask (every red line must be selected in the resizing diagram).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top