【发布时间】:2021-09-30 06:15:58
【问题描述】:
我想让我的 Activity 出现在屏幕上,并且 StatusBar 透明,所以我写了这段代码:
window?.setDecorFitsSystemWindows(true)
window?.statusBarColor = Color.TRANSPARENT
我的 targetVersion 是 30 我的 appcompat 版本是 1.3.0
但是当我运行它时,我得到了这样的异常 enter image description here
【问题讨论】:
-
试试这个
WindowCompat.setDecorFitsSystemWindows(window, true)...另外请将完整的堆栈跟踪添加为文本而不是图像。 -
谢谢,它有效,也谢谢你的建议
标签: android statusbar android-statusbar android-window