【问题标题】:iPad orientation issue in iOS 5iOS 5 中的 iPad 方向问题
【发布时间】:2012-12-23 16:11:07
【问题描述】:
我在 StoryBoard 中有 UISplitViewController,它是初始视图,我希望应用仅在横向模式下工作。
我已将方向限制为仅横向,甚至将 plist 初始界面方向设置为横向(右主页按钮)。
在 iOS 6 中一切正常,它只显示主视图和细节视图,但在 iOS 5 中它卡在纵向模式并且只显示细节视图。
请帮我解决这个问题,我在过去 2 个小时里都被它困住了......
【问题讨论】:
标签:
iphone
ios
ipad
orientation
landscape
【解决方案1】:
您需要在 UISplitViewController 中包含的视图控制器中实现 shouldAutorotateToInterfaceOrientation:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return UIInterfaceOrientationIsLandscape(toInterfaceOrientation);
}