I just wanna restrict my app to work in Portrait mode. How to disable app rotation? @leob Hope you have knowledge on this…
Hi, I think this question has been discussed and answered before on the Ionic forum, the simplest way seems to be this:
So, quoting the answer:
In config.xml include following:
<preference name="SplashScreen" value="screen" />
<preference name="orientation" value="portrait" />
<preference name="SplashScreenDelay" value="5000" />
and inside $ionicPlatform.ready(function() {}) include following:
if(window.navigator && window.navigator.splashscreen) {
window.plugins.orientationLock.unlock();
}
I saw more discussions and solutions but this seems to be the easiest one.
config.xml
Yeah I’ve also seen people talk about a plugin:
Freezing portrait mode
Ionic View iOS App: Screen Orientation Locked?
http://www.gajotres.net/changing-locking-screen-orientation-in-ionic-application/
So then you can try that (I don’t have experience with any of this since I don’t have this requirement).