我已经从 here 下载了示例代码并进行了测试。我无法理解的是,当我将方向设置为 Landspace only 并在 Portrait 模式下运行时,没有任何变化。我的意思是我仍然应该能够看到左侧的菜单,而 Psychologist 按钮不应该在那里。
PS:在 iOS6 上,它运行良好,但较低的版本给我相同的结果。
最佳答案
它看起来像在 RoatatableViewController.m 文件中的方法
- (BOOL)shouldAutorotateToInterfaceOrientation:
告诉应用程序可以在所有方向上旋转。
你应该使用它来阻止 iOS 5 及更早版本的横向模式:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
看起来在斯坦福创建这个项目的人忽略了这一点。
关于ios - UISplitView 横向模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12171129/