ios6 Rotation issue from landscape to portrait mode

梦想的初衷 提交于 2019-12-23 09:48:53

问题


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;
}

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

Thanks !!


回答1:


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.



来源:https://stackoverflow.com/questions/12708652/ios6-rotation-issue-from-landscape-to-portrait-mode

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!