我有一个支持横向和纵向的应用程序 . 但是,根视图控制器仅支持纵向 . 以下是我为根视图控制器覆盖的两种方法 .

-(BOOL) shouldAutorotate {
return NO;
}

-(UIInterfaceOrientationMask) supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}

iphone5 / 5s / 6 / 6s的方向正常 . 但是对于iphone 6,当我旋转设备格局然后启动应用程序时,根视图控制器将以横向显示 .

操作系统:iOS9.0设备:iPhone6