Suitable Content on Your UIWebview iPad

I'm new to developing an iPad,

I made an epub reader and loaded every epub page in my webview when I see that my application is not in portrait scroll mode because I used

webview.scalesPageToFit=TRUE;

When I see my application in landscape scrolling, I even used it,

webview.scalesPageToFit=TRUE;

I don’t need scrolling, I want the content to fit the screen size.

here is my code snippet:

 - (void) adjustViewsForOrientation:(UIInterfaceOrientation)orientation { if(orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) { _webview.frame=CGRectMake(0, 0, 770, 960); } else if (orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight) { _webview.frame=CGRectMake(0, 0, 1030, 705); } } 

see my picture:

You can see that in landscape mode there is a scroll, and in portrait mode there is a lot of free space.

In short, I want to increase the size of the UIWebView content in the portrait and reduce the size of the UIWebView content in the landscape, then the content will fit the screen size without scrolling.

Any help would be appreciated!

+4
source share

All Articles