Xcode not obeying device orientation

帅比萌擦擦* 提交于 2019-12-10 12:59:24

问题


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

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