if (Build
.VERSION.SDK_INT >= Build
.VERSION_CODES
.LOLLIPOP) {
getWindow()
.setStatusBarColor(getStatusColor())
} else if (Build
.VERSION.SDK_INT >= Build
.VERSION_CODES
.KITKAT
&& Build
.VERSION.SDK_INT < Build
.VERSION_CODES
.LOLLIPOP) {
Window window = getWindow()
window
.addFlags(WindowManager
.LayoutParams.FLAG_TRANSLUCENT_STATUS)
}
布局文件需要加上:
android:clipToPadding=
"true"
android:fitsSystemWindows=
"true"
转载请注明原文地址: https://ju.6miu.com/read-36609.html