【发布时间】:2012-08-24 01:32:02
【问题描述】:
横向模式可以禁用全屏模式吗?
如果没有,有什么解决方法吗?
【问题讨论】:
-
除非您指定,否则它应该不是全屏!
标签: android landscape landscape-portrait
横向模式可以禁用全屏模式吗?
如果没有,有什么解决方法吗?
【问题讨论】:
标签: android landscape landscape-portrait
将此代码放在 onCreate() 方法中。
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT)
{
//To re-enable full screen:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
}
else if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE)
{
//To disable full screen:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
【讨论】: