我在整个网上搜索了几天,但找不到答案。
问题是:我无法强制我的应用程序以纵向模式呈现所有UIViewControllers,除了一个UIViewController,它应该能够在4种模式中的每一种模式下工作。
这些是我的选择:
我已经尝试了
- (BOOL)shouldAutorotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
但它似乎无法正常工作..
有什么想法吗?
答案 0 :(得分:0)
找到答案:
子类UINavigationController(https://stackoverflow.com/a/12999017/1011125)或UITabBarController(如果使用)。
就是这样:)。