最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Portrait Orientation? - Stack Overflow

programmeradmin6浏览0评论

How do I lock the orientation of my phonegap application to portrait?

My current config.xml is using this preference:

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

However it makes no difference and I can still orientate my application in both orientations by rotating my mobile test device.

Also if you know of a an active phonegap/cordova munity could you please post a link?

How do I lock the orientation of my phonegap application to portrait?

My current config.xml is using this preference:

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

However it makes no difference and I can still orientate my application in both orientations by rotating my mobile test device.

Also if you know of a an active phonegap/cordova munity could you please post a link?

Share Improve this question asked Jan 2, 2014 at 14:04 jshbrnttjshbrntt 5,4358 gold badges32 silver badges64 bronze badges 1
  • What type of os you're testing on? Maybe this helps? stackoverflow./questions/18477050/… – Eric Geurts Commented Jan 2, 2014 at 14:10
Add a ment  | 

1 Answer 1

Reset to default 9

If you are working with Android you can add

android:screenOrientation="portrait"

to the main activity tag in the platforms/android/AndroidManifest.xml file.

So

<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/app_name" android:name="inappbrowser" android:theme="@android:style/Theme.Black.NoTitleBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

bees

<activity android:screenOrientation="portrait" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/app_name" android:name="inappbrowser" android:theme="@android:style/Theme.Black.NoTitleBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

Just another note in case you want other portrait variations. From: http://developer.android./guide/topics/manifest/activity-element.html

You could use reversePortrait or sensorPortrait

发布评论

评论列表(0)

  1. 暂无评论