在小米8等一系列圆角的手机上测试项目时,发现我的自定义dialog无法全屏了,这时我的dialog全屏的解决方案还是和网上大部分人是一样的
Window window = getWindow(); if (window == null) return; window.getDecorView().setPadding(0, 0, 0, 0); window.setGravity(gravity); WindowManager.LayoutParams layoutParams = window.getAttributes(); layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT; layoutParams.height = WindowManager.LayoutParams.WRAP_CONTENT; window.setAttributes(layoutParams);