how do you make an app ONLY support landscape? No portrait mode JUST landscape throughout the whole thing in xcode 3?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
- Attempt to present UIAlertController on View Contr
The accepted answer did not work for me. This did:
In the properties file for your app (YOURAPPNAME-Info.plist), located in the "supporting files" group, there is an array called "Supported interface orientations". Remove the orientations you don't want from the array, and your app will be locked into the remaining orientation.
My naive answer is to add this method in all of your root view controllers:
This is what I do in my game. Of course, my game only has one view controller.
Also, I found it helpful to set "Initial interface orientation" in my app's info.plist to Landscape.
Orientations are now easily set using the target's summary tab.
We can change the orientation by simply selecting the required orientations as well. Select the device from "devices" and change the orientation
You can change the Supported interface orientations in your info.plist file, as shown below: