I'm building a tilt-based game and want to lock the orientation to 1 particular landscape orientation (UIInterfaceOrientationLandscapeRight on iOS). However, if you set the cordova Orientation preference to landscape, it can still rotate 180 degrees to either landscape mode, which isn't acceptable for me. Is this a shortcoming of cordova? I need this, and it's trivial to do natively, so seems like there ought be an easy way to do it.
I'm aware of cordova-plugin-screen-orientation, but it only does stuff once your javascript has started running, which is too late for your splash screen.
Currently I am finding the answer for Android and the accepted answer cannot be used now. In Cordova root folder config.xml add:
<platform name="android">
<preference name="orientation" value="landscape" />
</platform>
Then the app will be landscaped.
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