代码如下(实现右横屏),注意这个页面必须用present的方式推出.
(而且是必须present这个VC, 不能present被导航控制器管理的VC)
-(BOOL)shouldAutorotate
{
return NO;
}
-(UIInterfaceOrientationMask)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscape;
}
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeRight;
}
(根视图到A,A present B)代码添加在B中!
网友评论