uiwebview - How to resize webview correctly in landscape mode in iPhone? -
uiwebview - How to resize webview correctly in landscape mode in iPhone? -
i add together navigationbar, webview , toolbar(from top bottom) subviews of viewcontroller's view. want navigationbar , toolbar's height shrink little in landscape orientation utilize autoresizingmask create height flexible. (uiviewautoresizingflexibleheight create navigationbar , toolbar's height shrink 44 around 30):
webnavbar.autoresizingmask = uiviewautoresizingflexiblewidth | uiviewautoresizingflexibleheight | uiviewautoresizingflexiblebottommargin; webtoolbar.autoresizingmask = uiviewautoresizingflexiblewidth | uiviewautoresizingflexibleheight | uiviewautoresizingflexibletopmargin; webview.autoresizingmask = uiviewautoresizingflexiblewidth | uiviewautoresizingflexibleheight;
now found when rotate device landscape mode, there 2 blank white bars on top , bottom of webview(each blank bar's height 44-30). navigationbar , toolbar appear in right position. there way resize webview , fill gaps?
are sure autoresizing margins set correctly webview? do:
-(void)willrotatetointerfaceorientation:(uiinterfaceorientation)tointerfaceorientation duration:(nstimeinterval)duration { webview.frame = self.view.frame; }
no thought if work worth shot.
iphone uiwebview resize landscape
Comments
Post a Comment