【发布时间】:2016-03-22 05:14:52
【问题描述】:
我想在 iPhone 和 iPad 中锁定单个视图控制器。 下面的代码在 iPhone 4、5、6 iPad、iPad 2、iPad Retina 中完美运行。 但不适用于 iPad pro。
@implementation UINavigationController (Orientation)
-(NSUInteger)supportedInterfaceOrientations
{
return [self.topViewController supportedInterfaceOrientations];
}
-(BOOL)shouldAutorotate
{
return YES;
}
@end
上面的代码写在我不想旋转的视图控制器中。
【问题讨论】:
-
什么是 iPad pro 上的 iOS 版本
-
永远不要尝试使用类别覆盖方法。这是未定义的行为。
-
我尝试了以下解决方案,但它不起作用@Chetan
-
请查看此网址stackoverflow.com/questions/35794712/… 可能对您有所帮助
标签: ios objective-c orientation portrait