我在一些小部件(即抽屉导航)中阅读了一些有关android fitsSystemWindows属性和自定义行为的文章,毫无疑问。但是从文档中我无法真正理解windowTranslucentStatus和windowDrawsSystemBarBackgrounds之间的区别。有人可以解释何时/不应该使用每个属性吗?
我想我需要使用windowTranslucentStatus + fitsSystemWindows和windowTranslucentNavigation + clipToPadding,但是windowDrawsSystemBarBackgrounds的作用是什么?
最佳答案
当android:windowTranslucentStatus
设置为true
时,窗口请求透明状态栏
WindowTranslucentStatus documentationandroid:windowDrawsSystemBarBackgrounds
设置为true
可以使所有内容都可以在API级别21及更高级别的状态栏下绘制。