2014-06-26 26 views
1

我有2 ViewControllers,主要一个shouldAutoRotate-NO和第二个与shouldAutoRotate-YES。 我正在使用函数presentViewController:并使用UIModalPresentationCurrentContext来呈现第二个ViewController,因为我在第二个背景上有一个透明背景,仍然可以查看背面的第一个背景。Segue IOS7错误的ViewController方向

的问题是,当我在“风景”第一ViewController(在因为shouldAutoRote-NO的肖像出现),我提出第二ViewController,第二个正好出现在的风景,但如果我转动我的iPhone背纵向我不会旋转,除非我将手机旋转回风景,这使得方向再次正常工作。

状态栏的行为总是正确的,问题出在ViewControllers

有什么建议吗?

回答

0
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    // Return YES for supported orientations 
     return UIInterfaceOrientationIsLandscape(interfaceOrientation); 
} 

-(NSUInteger)supportedInterfaceOrientations 
{ 
     return UIInterfaceOrientationMaskAll; 
} 

你可以简单地提供你想要的视图控制器的类型。

+0

自从ios5以后,shouldAutorotateToInterfaceOrientation不再受支持,再加上这并不能真正解决帖子中描述的问题,谢谢! – user3764078