[英]UINavigationController Orientation
I have UINavigationController with couple of view controller. 我有几个视图控制器的UINavigationController。 this is the list of them: Main -> Album -> image
这是它们的列表:Main-> Album-> image
Now in the first and the second(Main and album) i want that the UINavigationController will not rotate(only portrait), and in the third one(Image) it will be possible to rotate. 现在,在第一个和第二个(主要和专辑)中,我希望UINavigationController不旋转(仅纵向),而在第三个(图像)中可以旋转。
i made already category for the UINavigationController: 我已经为UINavigationController制作了类别:
-(BOOL)shouldAutorotate {
if ([self.topViewController isKindOfClass:[MWPhotoBrowser class]]) {
return YES;
}
return NO;
}
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
if ([self.topViewController isKindOfClass:[MWPhotoBrowser class]]) {
return YES;
}
return NO;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskAll;
}
Now my problem is that when i push the image viewcontroller and the rotate the device (the viewcontroller rotate) and press back and here(Album) the viewcontroller is rotate to and can't rotate back to portrait. 现在我的问题是,当我按下图像视图控制器并旋转设备(视图控制器旋转)并按回去时,此处(相册)中的视图控制器将旋转到并且不能旋转回纵向。
By the way: i noticed it happen only in device with iOS 6 and iPhone 5 顺便说一句:我注意到它仅在装有iOS 6和iPhone 5的设备中发生
您是否尝试过包含以下方法,但为视图控制器返回正确的值?
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortraitUpsideDown;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.