dialog即使设置全屏了,但还是有状态栏占用高度这;
直接将下面这行代码放到你的dialog中即可
@Override
protected void onStart() {
super.onStart();
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_IMMERSIVE
| View.SYSTEM_UI_FLAG_FULLSCREEN;
this.getWindow().getDecorView().setSystemUiVisibility(uiOptions);
}
顺便说下自定义dialog宽高:
WindowManager.LayoutParams attributes = getWindow().getAttributes();
attributes.width = width;
attributes.height = height;
getWindow().setAttributes(attributes);
添加两个基本的style
@null
true
true
true
@android:color/transparent
@android:color/transparent
st