Reputation: 119
I'm using Phonegap Desktop/CLI to test my app. I'd like to force the screen orientation to be portrait.
I've added this line to my config.xml:
<preference name="orientation" value="portrait" />
Then I run "phonegap serve". This works neither from Android or iOS.
The app screen listens to the orientation of the phone, turning from portrait to landscape as you rotate it.
Upvotes: 1
Views: 2073
Reputation: 3039
With this plugin you can force orientation
https://github.com/gbenvenuti/cordova-plugin-screen-orientation
Upvotes: 0
Reputation: 119
Looks like this is unsupported with "phonegap serve". I had to build the app package (apk/android ipa/ios) and install it to my device to get it to work.
I used build.phonegap.com but I guess you can use the SDK's aswell.
Upvotes: 1