Disable auto-rotate in Jquery Mobile or PhoneGap

Mustafa Hanif picture Mustafa Hanif · May 19, 2011 · Viewed 13.1k times · Source

Although cross platform development for mobile devices is so good. There isn't a simple option to disable auto-rotate or lock into one orientation i.e. portrait or landscape.

Is there anyway either in Jquery Mobile, PhoneGap, XUI anywhere ?

If yes then please help. Its driving me nuts.

Answer

David Dehghan picture David Dehghan · Jun 13, 2011

To complete the answer above.

On iPhone add this to -info.plist:

<dict>
`.....
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
    </array>
..........
</dict>

on Android to AndroidManifest.xml

<activity   ........      android:screenOrientation="portrait">