This one should be very simple, however it's not. I'm trying to prevent my application from going into landscape view so I've changed the config.xml
file like this: <preference name="orientation" value="portrait" />
. Unfortunately, it's not working. Any ideas?
Now Goto -> General -> Deployment Info and only select the Portrait mode. 4. Now Re-run your project. This would disable the landscape mode in your current application in android devices.
To change device orientation for a specific screen:Step 1: Open the screen in which you want to set the orientation. Step 2: Add the init() method and then call the SystemChrome. setPreferredOrientations method to set only landscape mode. Step 3: Add the dispose method and then call the SystemChrome.
Ok, so I got it: The reason Phonegap ignored the <preference name="orientation" value="portrait" />
in the config.xml
file is because my app was in debug mode. once I created a release version it stopped from going to landscape.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With