使用的是Android Studio 3.6.x,打開Manifest.xml,存在以下錯誤提示:
Expecting 'android:screenOrientation="unspecified"' or '"fullSensor"' for this activity so the user can use the application in any orientation and provide a great experience on Chrome OS devices.
原因
這是一種警告,提示我們,對於大屏幕設備,不建議限制方向。
限制豎屏,屏蔽提示的解決方法
如果確實要限制爲豎屏,可以按以下步驟:
- Mac: Android Studio -> Preferences
- Windows: File -> Settings
1、在配置搜索"inspections"
2、把"Activity is locked to an orientation"勾選去掉
3、應用,確定