ios6从横向模式到纵向模式的旋转问题 [英] ios6 Rotation issue from landscape to portrait mode

查看:91
本文介绍了ios6从横向模式到纵向模式的旋转问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am using New orientation methods of ios 6 and it is working fine. My view is presenting in portrait mode and when I presentviewcotrnoller and rotate it to landscape , dismiss that viewcontroller it reverts orientations. means it should remain in landscape but it becomes to portrait. Here is my code.

- (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方法,但没有得到解决方案this.Please Help!

I think it is happening because of preferredInterfaceOrientationForPresentation method ,but not getting the solution for this.Please Help !

谢谢!!

推荐答案

如果你想要在开始时支持所有的interfaceOrientations,不要编写preferredInterfaceOrientationForPresentation方法,因为它始终只需要首选的Interface方向。

If you want all the interfaceOrientations supported at the start, do not write the preferredInterfaceOrientationForPresentation method, as it would take just that preferred Interface orientation all the time.

这篇关于ios6从横向模式到纵向模式的旋转问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆