Forced orientation orientation mode for Phonegap / Cordova iOS app

Can I use Phonegap to use landscape mode only?

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

The only thing that can be found in Phonegap is the orientation in the config.xml file:

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

This preference allows the application to be displayed in landscape mode, but allows you to rotate the screen 180 degrees. This is not the desired result.

+4
source share
2 answers

Solution found:

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

0
source

For ios

In the config.xml file:

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

or

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

"ProjectName" -info.plist ios "UISupportedInterfaceOrientations" :

UIInterfaceOrientationLandscapeLeft

UIInterfaceOrientationLandscapeRight

:

UIInterfaceOrientationPortrait

UIInterfaceOrientationPortraitUpsideDown

, .

+2

Source: https://habr.com/ru/post/1532844/


All Articles