【发布时间】:2015-02-06 10:05:04
【问题描述】:
我正在做this,试图在横向中只看到一个画廊,但是当我以模态方式将照片库与主 ViewController 连接时,我只能显示横向:
RootViewController -(modal segue)> PhotoGallery
问题出在我这样做的时候:
Rootviewcontroler -(modal segue)> ViewControllerModal -(modal segue)> PhotoGallery
它不起作用,也不适用于导航控制器:
RootViewController -(modal segue)> NavigationController A -(push segue)> NavigationController B -(modal segue)> PhotoGallery
我也不知道如何在supportedInterfaceOrientationsForWindow 中将层次结构向上导航到图库:
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{
if ([self.window.rootViewController.presentedViewController isKindOfClass: [PhotoGallery class]]){
PhotoGallery *photoGallery = (PhotoGallery *) self.window.rootViewController.presentedViewController;
if (photoGallery.isPresented) return UIInterfaceOrientationMaskLandscape;
else return UIInterfaceOrientationMaskPortrait;
}
return UIInterfaceOrientationMaskPortrait;
}
提前致谢。
【问题讨论】:
标签: ios objective-c iphone orientation hierarchy