[英]Why screenOrientation=“landscape” not working on nexus 5
我将方向屏幕设置为横向屏幕,但无法在nexus 5上运行。我尝试了其他设备,并且工作成功。
<activity
android:name=".PlayGameActivity"
android:screenOrientation="landscape"
android:configChanges="keyboardHidden|orientation">
</activity>
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
setContentView(R.layout.play_game_layout);
}
请告诉我为什么我的代码不能在nexus 5上运行。
尝试这个
<uses-feature android:name="android.hardware.screen.landscape"/>
如果无法使用,请检查您的AVD
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.