Question

Is it possible to enforce your Phonegap app to use right landscape orientation mode only?

I know this is possible for a native iOS app (see screenshot of setting in Xcode) enter image description here

The only thing for Phonegap I can find is the orientation preference in the config.xml:

<preference name="orientation" value="landscape" />

This preference enforces to show the app in landscape mode but allows you to rotate your screen 180 degrees. This isn't the desired result.

Was it helpful?

Solution 2

Solution found:

<gap:config-file platform="ios" parent="UISupportedInterfaceOrientations" overwrite="true">
<array>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>

OTHER TIPS

For IOS

In config.xml set:

<preference name="orientation" value="landscape"></preference>

or

<preference name="orientation" value="portrait"></preference>

In "ProjectName"-info.plist file in ios folder under resources folder for "UISupportedInterfaceOrientations" set:

UIInterfaceOrientationLandscapeLeft

or

UIInterfaceOrientationLandscapeRight

or

for portrait orientation:

UIInterfaceOrientationPortrait

or

UIInterfaceOrientationPortraitUpsideDown

Include which is applicable for your requirements.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top