Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force portrait orientation on iPhone with phonegap [duplicate]

I want portrait orientation for my application, I tryed with:

AndroidManifest.xml:

<activity ... android:screenOrientation="portrait" ... android:configChanges="orientation| ..." />

and config.xml:

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

That works perfectly on my android phone, but not on iPhone 4.

Thanks!

like image 753
Enacefio Avatar asked Dec 26 '22 09:12

Enacefio


1 Answers

Open 'ProjectName'-info.plist file in Xcode.

In 'Supported interface orientations' array, keep support for Portrait mode only.

Like this-

enter image description here

then your phonegap app will run only in Portait Mode on iPhone.

like image 118
Mayur Birari Avatar answered Feb 06 '23 11:02

Mayur Birari