uiwebview - How to resize webview correctly in landscape mode in iPhone? -


I have a navigation bar, a webview and a toolbar (from top to bottom) in my view controller's view of sub-scenes I want to add that if the height of the navigation bar and the toolbar's height are slightly lower in the landscape orientation, then I am using the autorescosing mask to make the height flexible. (UIViewAutoresizingFlexibleHeight Navigation Bar and toolbar height will decrease from 44 to 30):

  webNavBar.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleBottomMargin; WebToolBar.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleTopMargin; WebView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;  

Now I came to know that when I rotate the device in landscape mode, there will be two blank white bars above and below the webview (each empty bar has a height of 44-30). Navbar and Toolbar appear in the correct position. Is there any way to change the size of the webview and fill the gap?

Are you sure that the right way to automatically webview? Can always do this:

- (zero) HogarotettoInterface Operation: (UINPreference Orientation) Interface: Duration: {webView.frame = self.view.frame; }

No idea that he will work but deserve a shot.


Comments