关于Android启动页全屏的解决方案
16lz
2021-01-23
关于启动页全屏的解决方案
该方法放到setcontentview之前
private void full(boolean enable) { if (enable) { WindowManager.LayoutParams lp = getWindow().getAttributes(); lp.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN; getWindow().setAttributes(lp); getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); } else { WindowManager.LayoutParams attr = getWindow().getAttributes(); attr.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN); getWindow().setAttributes(attr); getWindow().clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); } }
更多相关文章
- Android Studio编译中“png-cruncher_*”异常的解决方案
- LayoutInflater.inflate()方法的介绍
- android 笔记 --- 自定义Android主题风格theme.xml方法
- android工程下运行main方法的配置方法
- Android Studio无法新建创建android工程解决方法
- Android Studio设置主题 和 不支持中文的问题解决方法
- Flutter下载更新App的方法示例