public void toggleFullscreen(boolean fullScreen)
{
//fullScreen为true时全屏,否则相反
WindowManager.LayoutParams attrs = getWindow().getAttributes();
if (fullScreen)
{
attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
}
else
{
attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN;
}
getWindow().setAttributes(attrs);
}
任意时刻、任意代码处全屏
最新推荐文章于 2018-11-13 05:59:31 发布