沉浸式中DialogFragment怎么能遮住statusbar或者说是高度全屏
https://blog.csdn.net/a940659387/article/details/81773416
试了楼上的方法:https://blog.csdn.net/a940659387/article/details/81773416
没有直接生效。
style加了windowFullscreen=true之后就可以了:
<style name="Dialog.FullScreen" parent="Theme.AppCompat.Dialog">
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowIsFloating">false</item>
<item name="android:windowFullscreen">true</item>
</style>
<style name="Dialog.FullScreen.NoDim">
<item name="android:backgroundDimEnabled">false</item>
</style>
重点是 <item name="android:windowFullscreen">true</item>
除了配置上相关的window主题属性后,还需要考虑各种Android系统版本,刘海屏、水滴屏等异形屏,在现代很多安卓手机里,异形屏的区域默认是不能被DialogFragment铺满的,这里提供了一种更优雅的解决方式,可完美解决DialogFragment所有的布局问题,包括设置背景无效、宽高无效、无法全屏等,详情请看:https://blog.csdn.net/h_xiao_x/article/details/109693447