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
The "General"->"Deployment Info" UI in Xcode can be deceiving. Check these two keys in your info.plist
:
UISupportedInterfaceOrientations
and
UISupportedInterfaceOrientations~ipad
In my case (Xcode 13.1),It works perfectly for me:
Follow steps:
Build Settings
;All
and Combined
options;orientation
keywordsSupported interface Orientations(iPhone)
, click the value of it on the right;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".
I have the same problem and costed my entire day onto it, i resolved by doing this: override the AppDelegate method
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
if self.allowOrentitaionRotation {
return .allButUpsideDown;
}
return .portrait;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With