Is it possible to lock an android app in portrait mode only on phones with cordova? -
i app support following orientations:
- on phones: portrait or reverse-portrait
- on tablets: portrait, reverse-portrait, landscape, reverse-landscape
i finding lot of information how in android application, not in cordova application. there no way without having modify java code?
i have solved problem on ios adding following project's plist file:
<key>uisupportedinterfaceorientations</key> <array> <string>uiinterfaceorientationportrait</string> <string>uiinterfaceorientationportraitupsidedown</string> </array> <key>uisupportedinterfaceorientations~ipad</key> <array> <string>uiinterfaceorientationportrait</string> <string>uiinterfaceorientationlandscapeleft</string> <string>uiinterfaceorientationportraitupsidedown</string> <string>uiinterfaceorientationlandscaperight</string> </array>
the plist file created cordova , it's xml file, it's easy make script adds these configurations every time build.
but on android, there seems 1 property in androidmanifest.xml applies both phones , tablets. cordova way of doing this?
yes, it's possible lock android app in portrait mode on phone cordova/phonegap app
at first, open cordova/phonegap app directory, find config.xml file add syntax<preference name="orientation" value="portrait" />
and more info: config.xml - apache cordova, preference
Comments
Post a Comment