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?
相关问题
- Should I use CSS3 media queries to deliver differe
- apk big size with ionic 4 build
- Grails External Configuration. Can't access to
- How to read file in android using PhoneGap Javascr
- .NET - Storing An App.config With A Class Library
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- Phonegap - Error - Keystore alias not recognized
- Can't use serve with Cordova / Phonegap hellow
- ionic - Copy/paste in input field in iOS 10 not wo
- Including a generic class in Unity App.Config file
- PhoneGap iOS 7 and localStorage
- deviceready not firing in cordova
- net::ERR_CONNECTION_REFUSED ionic
For platform android just set prefered orientation in androidManifest.xml like this
For IOS the following link may help you
Force portrait orientation on iPhone with phonegap
Small piece of code and here you go. Try it.
Ok, so I got it: The reason Phonegap ignored the
<preference name="orientation" value="portrait" />
in theconfig.xml
file is because my app was in debug mode. once I created a release version it stopped from going to landscape.hello you can install this plugin https://github.com/gbenvenuti/cordova-plugin-screen-orientation
and add this function on you index.js or one of your first executed js document
thank u