ios - UIWebview Landscape support in Hybrid Application -
i developing hybrid application using uiwebview. html pages loaded local. have requirement 1 page should support both landscape , portrait mode. rest html page should support portrait mode only. have done following implementation that:
- (nsuinteger) application:(uiapplication *)application supportedinterfaceorientationsforwindow:(uiwindow *)window{ if (isfullscreenplaying) { nslog(@"**********************************orienattion landscape%@",[window description]); return uiinterfaceorientationmaskallbutupsidedown; } nslog(@"**********************************orienattion portrait%@",[window description]); return uiinterfaceorientationmaskportrait; }
i enabling isfullscreenplaying variable when have have url request equal full screen playing:
**if([urlstring hasprefix:@"fullscreenvieweron://"]){ nslog(@"**********************************isfullscreenplayingyes"); isfullscreenplaying = yes; return no; }**
but problem comes after user rotate device in landscape. full screen html page come in landscape mode. bur when user close full screen html page previous loaded page in landscape mode. there way in html or native ios side can set orientation support particular html page ?
finally applying various tricks come solution. posted in following link:
http://cocoainios.blogspot.in/2014/11/implement-orientation-modes-in-iphone.html
Comments
Post a Comment