我在纵向模式下拥有所有应用程序,但我在横向模式下有一个viewcontroller是图像库.
在项目摘要选项卡上启用LandscapeLeft模式,所以我必须在ViewController的其余部分禁用旋转,除了在图像库的VC中.
我想在纵向模式下保持旋转,要执行此操作并阻止所有VC纵向,我使用以下代码
-(BOOL)shouldAutorotate{
return YES;
}
-(NSInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
}
return UIInterfaceOrientationPortrait;
}
Run Code Online (Sandbox Code Playgroud)
这个,让我在之前的VC中保持横向模式,它应该旋转到Portrait.
有什么想法吗?