我有一个 iPad TabBarApplication。我将 TabbarController 子类化以使应用程序对方向更改使用react:
@implementation frankenlandTabBarController
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (
interfaceOrientation == UIInterfaceOrientationPortrait ||
interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
interfaceOrientation == UIInterfaceOrientationLandscapeRight
);
}
@end
现在的问题是,我不希望我的 tabbarapp 的所有 View Controller 都在这个方向上。
在单个 Controller 中覆盖 shouldAutorotateToInterfaceOrientation
方法没有任何效果。
有什么想法吗?
谢谢!
最佳答案
无法更改 tabBar 中一个 View 的方向而不更改另一个 View 的方向。如果指定了 TabBar,则所有 subview (选项卡)必须具有相同的方向外观。您必须在每个 ViewController 和 TabBarController 中设置方向。
关于objective-c - 不同方向的 UITabbar 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4114260/