使用phonegap强制iPhone上的纵向方向

Ena*_*fio 4 iphone android ios cordova

我想为我的应用程序设置纵向,我试着:

AndroidManifest.xml中:

<activity ... android:screenOrientation="portrait" ... android:configChanges="orientation| ..." />
Run Code Online (Sandbox Code Playgroud)

和config.xml:

<preference name="orientation" value="portrait" />
Run Code Online (Sandbox Code Playgroud)

这完全适用于我的Android手机,但不适用于iPhone 4.

谢谢!

May*_*ari 9

在Xcode中打开'ProjectName'-info.plist文件.

在"支持的界面方向"数组中,仅保留对纵向模式的支持.

像这样-

在此输入图像描述

那么你的phonegap应用程序将仅在iPhone上的Portait模式下运行.