关于Android启动页全屏的解决方案

来源:互联网 发布:非平衡面板数据 编辑:程序博客网 时间:2024/06/08 04:36

关于启动页全屏的解决方案

该方法放到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);        }    }
原创粉丝点击