0
当我创建一个应用程序我没有肖像模式的问题,但是当我把谷歌地图它允许查看横向模式。这里是我的代码:如何锁定旋转?
Android清单:
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="sensorPortrait"
android:configChanges="orientation|keyboardHidden|keyboard">
MainActivity.java:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
请帮我解决了英文不好
如果你想锁定它使用'SCREEN_ORIENTATION_PORTRAIT' – Oleg
我已经试过了,但仍允许在横向模式下的应用程序 – LogicTrix
哦,你想锁定不同的应用程序?我不认为这是可能的。 – Oleg