我知道之前有人问过这个问题,我实际上搜索了这些问题以确保我做的事情正确。我的应用需要保持纵向,所以我想禁止它旋转成横向。
在总结中,我只支持纵向和倒置的设备方向。在视图控制器中,我有:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{返回否;}
我有 6 个其他视图控制器,在每个视图控制器中我都有以下内容:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
但是当我在我配置的 iPhone 上测试应用程序时,它会旋转。呸呸呸。我究竟做错了什么?
谢谢
在模拟器中也是一样的。