简体   繁体   中英

Launching app in landscape only mode

I've written an app that supports only landscape mode. For some reason, it is being very stubborn. It launches and runs great on the simulator, but when I go to launch it on my device, it will not launch or rotate to landscape mode at all. I'm running 5.1 on my iPad , and using Xcode 4.6.2. Here is everything I've tried after searching on this site for a solution:

  1. Edited my -info.plist and deleted support for portrait mode in the supported orientation interface options

  2. In the projects target, in the supported interface orientations I highlighted only landscape left and right

3 Added:

(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {     
    return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

To my only ViewController file. It runs in landscape only on the simulator, but is being very difficult on my device. Does anyone have any ideas?

检查此技术说明 ,它描述了您的问题的对立面,但解决方案是相同的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM