我只能在 onCreate 方法中将 Activity 设置为全屏(在 setContentView 之前)?
有什么方法可以在 onCreate 之外设置为全屏吗?
Thanks
有可能!添加此代码。
// go full screen
WindowManager.LayoutParams attrs = mActivity.getWindow().getAttributes();
attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
mActivity.getWindow().setAttributes(attrs);
// go non-full screen
WindowManager.LayoutParams attrs = mActivity.getWindow().getAttributes();
attrs.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN);
mActivity.getWindow().setAttributes(attrs);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)