Segue IOS7之后的ViewController方向不正确
我有两个视图控制器,主视图控制器带有shouldAutoRotate NO,第二个视图控制器带有shouldAutoRotate YES。 我使用函数presentViewController:演示第二个ViewController,并使用UIModalPresentationCurrentContext,因为我在第二个ViewController上有一个透明的背景,可以在后面查看第一个ViewController 问题是,当我在横向视图中的第一个ViewController中时,由于shouldAutoNote否而出现在纵向视图中,并且我呈现第二个ViewController时,第二个ViewController正好出现在横向视图中,但是如果我将iPhone旋转回纵向视图,我将不会旋转,除非我将手机旋转回横向,否则是什么让方向恢复正常 状态栏的行为总是正确的,问题在于ViewController 有什么建议吗Segue IOS7之后的ViewController方向不正确,ios,uiviewcontroller,orientation,segue,landscape,Ios,Uiviewcontroller,Orientation,Segue,Landscape,我有两个视图控制器,主视图控制器带有shouldAutoRotate NO,第二个视图控制器带有shouldAutoRotate YES。 我使用函数presentViewController:演示第二个ViewController,并使用UIModalPresentationCurrentContext,因为我在第二个ViewController上有一个透明的背景,可以在后面查看第一个ViewController 问题是,当我在横向视图中的第一个ViewController中时,由于shoul
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}
您只需在当前视图控制器中提供所需的方向类型。shouldAutorotateToInterfaceOrientation自ios5以来不再受支持,而且这并不能真正解决本文中描述的问题,谢谢!!