简体   繁体   中英

set orientation portrait phonegap android

Im trying to set orientate to potraint in phonegap for android, I modify the androidManifiest.xml

<uses-feature android:name="android.hardware.screen.portrait" />

and also the config.xml

<preference name="orientation"                value="default" /> 

Delete <uses-feature android:name="android.hardware.screen.portrait" /> from your androidManifiest.xml

and add this

android:screenOrientation="portrait"

This is how part of your androidMadifiest.xml should look

<activity android:name="HelloWorld" android:label="@string/app_name"
                android:theme="@android:style/Theme.Black.NoTitleBar"
                android:screenOrientation="portrait"
                android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM