我有一个应用程序,其中我有一个UINavigationController
子类作为我的rootViewController
。我有一个UITableViewController
允许用户编辑一些设置,它应该始终处于纵向模式。将 MoviePlayer 组件推送到导航控制器后,我的应用程序还需要支持所有其他方向。
The UITableViewController
子类具有supportedInterfaceOrientations的实现:
- (NSUInteger)supportedInterfaceOrientations {
LLog();
return UIInterfaceOrientationMaskPortrait;
}
日志命令告诉我这实际上被调用了。
问题是不尊重返回值,即当我转动设备时屏幕会变成横向。
我该怎么做才能使设置视图始终以纵向显示,但允许视频查看器的方向更改?
更多信息:我的UINavigationController
子类不会覆盖 shouldAutorotate 或supportedInterfaceOrientations。我还没有实施
- (NSUInteger)application:(UIApplication *)application
supportedInterfaceOrientationsForWindow:(UIWindow *)window
方法在我的应用程序代理我已启用目标摘要中的所有方向。
我有一些问题ViewControllers
导航堆栈中支持所有方向,有些仅纵向,但是UINavigation
控制器返回所有应用程序支持的方向,这个小技巧帮助了我。
@implementation UINavigationController (iOS6OrientationFix)
-(NSUInteger) supportedInterfaceOrientations {
return [self.topViewController supportedInterfaceOrientations];
}
@end
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)