xCode6 incorrect view controller orientation when deployed to iOS7 device

落爺英雄遲暮 提交于 2019-12-11 07:16:10

问题


I'm running into a weird issue when testing an app with deployment target of 7.1 compiled with xCode6 and tested on an iOS 7.1.2 and iOS 8.0.2 devices.

A view controller is defined in storyboard with a portrait placeholder. The app supports landscape orientation only.

in app delegate:

@property (nonatomic,strong) UIViewController* privacyScreen;
self.privacyScreen = [kMainStoryboard instantiateViewControllerWithIdentifier:@"privacyScreen"];
[self.window addSubview:self.privacyScreen.view];

When deployed to iOS8, the status bar is in landscape and the view controller is in landscape. When deployed to iOS 7.1, the status bar is in landscape, but the view controller is in portrait

How can I make sure my view controllers are in the expected orientation, regardless of which iOS they run on? For example, I would expect to have no portrait view controllers if my app does not support portrait in the project settings.

来源:https://stackoverflow.com/questions/26147068/xcode6-incorrect-view-controller-orientation-when-deployed-to-ios7-device

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