papegoj
papegoj

Reputation: 119

Phonegap: Force screen orientation portrait/landscape

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

Answers (2)

V&#237;ctor
V&#237;ctor

Reputation: 3039

With this plugin you can force orientation

https://github.com/gbenvenuti/cordova-plugin-screen-orientation

Upvotes: 0

papegoj
papegoj

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

Related Questions