问题
I have set the Device Orientation to have only 'Portrait' checked in Xcode. However when I run my app in the simulator, it rotates in all orientations.
My Xcode setting
Showing correctly in Portrait (intended) and Landscape (not intended)
Anyone faced same issue before? Thanks
回答1:
The "General"->"Deployment Info" UI in Xcode can be deceiving. Check these two keys in your info.plist
:
UISupportedInterfaceOrientations
and
UISupportedInterfaceOrientations~ipad
回答2:
I have had the same problem (in physical devices). on iPhone it works fine but on iPad it does not work. The solution was to adjust the option of "devices" for both, in this case "landscape right".
来源:https://stackoverflow.com/questions/42279651/xcode-not-obeying-device-orientation