我正在使用 Samsung Galaxy Note 运行phonegap 应用程序。
当我拍照时,我可以看到屏幕在进入相机之前旋转。
我怎样才能禁用这个功能?
我尝试在主线程和相机活动上强制纵向,
但那些似乎不起作用:
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:debuggable="true">
<activity android:name=".App" android:windowSoftInputMode="adjustPan" android:screenOrientation="portrait"
android:label="@string/app_name" android:configChanges="orientation|keyboardHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.phonegap.DroidGap" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<intent-filter>
</intent-filter>
</activity>
<activity android:name="com.android.camera.Camera"
android:screenOrientation="portrait">
</activity>
</application>
您需要在清单上添加权限:
<uses-feature android:name="android.hardware.screen.portrait" />
应答器 android 文档使用功能 http://developer.android.com/guide/topics/manifest/uses-feature-element.html
例如,如果您的应用程序需要纵向,您应该声明<uses-feature android:name="android.hardware.screen.portrait"/>
这样只有支持纵向方向的设备(无论是始终支持还是由用户选择)才能安装您的应用程序。如果您的应用程序支持这两个方向,那么您不需要声明其中任何一个。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)