我有一个UIViewController与以下
代码:
- (BOOL) shouldAutorotate {
return NO;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationPortrait;
}
我没有使用UINavigationController.当显示此UIViewController时,设备仍将旋转到横向.我的目标是iOS 9,这里有什么问题?
所以问题是我已经定义了info.plist中允许的方向,这显然会覆盖整个项目中任何其他任何
内容.
为了纠正这个问题,我从info.plist中删除了条目,并在项目设置中定义了这些条目.现在一切都按预期工作.