我只需要在纵向模式下打开第一个视图控制器.由于其余视图控制器将使用两个方向.所以我在plist文件中添加了两个方向.
-(BOOL) shouldAutorotate {
//Never called
}
- (NSUInteger) supportedInterfaceOrientations {
//Never called
}
Run Code Online (Sandbox Code Playgroud)
任何人都可以告诉我如何限制
Nab*_*ani 11
通过创建UINavigationController类和重写来修复它
-(NSUInteger)supportedInterfaceOrientations
{
AppDelegate *appDelegate = (AppDelegate *) [UIApplication sharedApplication].delegate;
if(appDelegate.isOrientationOn) {
return UIInterfaceOrientationMaskAll;
}
return UIInterfaceOrientationMaskPortrait;
}
Run Code Online (Sandbox Code Playgroud)
在根窗口中使用此自定义导航控制器类,这就是全部.
| 归档时间: |
|
| 查看次数: |
9203 次 |
| 最近记录: |