首页 文章

ios6从横向模式到纵向模式的旋转问题

提问于
浏览
5

我正在使用ios 6的新定位方法,它工作正常 . 我的视图以纵向模式呈现,当我呈现viewviewrnoller并将其旋转到横向时,忽略该视图控制器它还原方向 . 意味着它应该保留在风景中但它变成了肖像 . 这是我的代码 .

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskAll;

}

// Tell the system It should autorotate
- (BOOL) shouldAutorotate {
    return YES;
}

// Tell the system which initial orientation we want to have
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
    return UIInterfaceOrientationMaskPortrait;
}

我认为这是因为preferredInterfaceOrientationForPresentation方法,但没有得到解决方案 . 请帮助!

谢谢 !!

1 回答

  • 6

    如果您希望在开始时支持所有interfaceOrientations,请不要编写preferredInterfaceOrientationForPresentation方法,因为它始终只需要首选的Interface方向 .

相关问题