Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent a Phonegap application to switch to landscape view

Tags:

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?

like image 407
DMEM Avatar asked May 15 '14 09:05

DMEM


People also ask

How do I turn off landscape mode in react?

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.

How do I change the orientation of my device flutter?

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.


1 Answers

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.

like image 96
DMEM Avatar answered Oct 06 '22 00:10

DMEM