ios - Control autorotation from a view controller without modifying the rest of the app -
i'm developing ios framework. contains view controller can displayed modally app using framework. don't have access app code, framework. i'd prevent autorotation when view controller being displayed. can done? i've tried returning no shouldautorotatetointerfaceorientation: in vc, doesn't called.
you add code appdelegate. allow other viewcontrollers respond autorotation calls.
- (nsuinteger)application:(uiapplication *)application supportedinterfaceorientationsforwindow:(uiwindow *)window{ /* in order allow views not support landscape mode able load in */ return uiinterfaceorientationmaskall; } also, in ios 6.0 , later shouldautorotatetointerfaceorientation: method has been deprecated. substituted following methods:
- (nsuinteger)supportedinterfaceorientations{ return uiinterfaceorientationmaskportrait; } - (uiinterfaceorientation)preferredinterfaceorientationforpresentation{ return uiinterfaceorientationportrait; } - (bool) shouldautorotate{ return yes; }
Comments
Post a Comment