【发布时间】:2012-09-24 14:09:55
【问题描述】:
我正在使用此代码
if ([self respondsToSelector:@selector(presentViewController:animated:completion:)])
{
[self presentViewController:navigationControllerCustom animated:YES completion:nil];
}
else
{
[self presentModalViewController:navigationControllerCustom animated:YES];
}
我的应用程序有两个方向纵向和纵向颠倒。此代码适用于 iOS 5.1,但方向不适用于 iOS 6
我还在我的navigationControllerCustom 班级中添加了此代码
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
}
-(NSUInteger)supportedInterfaceOrientations
{
return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);
}
请帮我解决这个问题。
提前致谢。
【问题讨论】:
-
我在为 iOS 6 编译的应用程序中遇到了同样的问题;除 UIInterfaceOrientationPortraitUpsideDown 外,所有方向均有效;很奇怪。
-
@MrJre 任何与此相同的解决方案都非常奇怪。
标签: iphone ios uinavigationcontroller orientation ios6