我有一个只在横向模式下运行的应用程序...它工作得很好,但我确实在我的应用程序中创建了另一个视图,他的xib是“landscape”,没有使用autolayout并且在我的控制器中实现了shouldAutoRotate ..但是我在这个视图中输入,视图与xib完全不同
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return ((toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight));
}
2 回答
在信息plist检查值
支持的界面方向
只保留这两项
风景(左主页按钮)
风景(右侧主页按钮)
我使用以下方法解决问题:
代替: