objective c - how to force the orientation of viewcontroller to be displayed from portrait when presenting modal viewcontroller from landscape view in ipad -
i have application there 2 viewcontrollers viewcontrollera , viewcontrollerb.when viewcontrollera loaded in portrait mode , click on submit button present on viewcontrollera viewcontrollerb presented in portrait mode.this working fine.when viewcontrollera loaded in landscape mode , click on submit want viewcontrollerb presented in potrait mode displayed in landscape mode.i want force viewcontrollerb displayed in portrait mode if presented landscape mode viewcontroller.this code:
this submit code of viewcontrollera
-(ibaction)submit { loginnewviewcontroller *lvc =[[loginnewviewcontroller alloc] initwithnibname:@"loginnewviewcontroller" bundle:[nsbundle mainbundle]]; [self presentmodalviewcontroller:lvc animated:yes]; } this viewcontrollerb
- (bool)shouldautorotate { return no; } - (nsuinteger)supportedinterfaceorientations { return (uiinterfaceorientationmaskportrait| uiinterfaceorientationmaskportraitupsidedown); }
if want change orientation when particular view showing, should call [uiapplication setstatusbarorientation:animated:] in button action method.
Comments
Post a Comment