草庐IT

windowDrawsSystemBarBackgrounds

全部标签

android - 我什么时候应该使用 windowDrawsSystemBarBackgrounds 属性?

我阅读了一些关于androidfitsSystemWindows属性和一些小部件(即抽屉导航)中的自定义行为的文章,没有问题。但是从文档中我无法真正理解windowTranslucentStatus和windowDrawsSystemBarBackgrounds之间的区别。有人可以解释一下何时应该/不应该使用每个属性吗?我想我需要使用windowTranslucentStatus+fitsSystemWindows和windowTranslucentNavigation+clipToPadding,但windowDrawsSystemBarBackgrounds有什么用?

android - 如何以编程方式设置 windowDrawsSystemBarBackgrounds?

我想以编程方式或在代码中添加属性windowDrawsSystemBarBackgrounds,而不是values-v21,因为我只在1个Activity中需要它,并且我在我的应用程序中使用了主题选择器,所以我不能有多个主题。是否可以在代码中启用此属性?如果可以,那我该怎么做呢?提前致谢。 最佳答案 我找到了答案:if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.LOLLIPOP){Windowwindow=getWindow();window.clearFlags(WindowManage