小编meg*_*ara的帖子

如何强制视图控制器保持纵向模式?

我有一个带故事板的iOS应用程序.我希望我的上一个viewcontroller始终处于纵向模式.我一直在读书,从那以后我发现了

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
Run Code Online (Sandbox Code Playgroud)

不推荐使用我应该使用其他方法

-(BOOL)shouldAutorotate  
-(NSInteger)supportedInterfaceOrientations
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
Run Code Online (Sandbox Code Playgroud)

但我已经尝试了很多这种方法的组合,我无法做到这一点.所以请有人能告诉我正确的方法吗?

xcode rotation screen-orientation ios landscape-portrait

0
推荐指数
1
解决办法
2304
查看次数