Lock screen orientation

How can i lock screen orientation?
I need to stay in vertical.

Add this line to your config.xml file:

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

Or you can do this programmatically using net.yoik.cordova.plugins.screenorientation Cordova plugin.

It’s as simple as this:



Read more about it here, there’s also a working example you can play with: http://www.gajotres.net/changing-locking-screen-orientation-in-ionic-application/

1 Like