And*_*ano 5 android android-design-library
那是:
我尝试过的
设置windowTranslucentStatus会禁用windowLightStatusBar:
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowTranslucentStatus">true</item>
Run Code Online (Sandbox Code Playgroud)
只允许完全透明(中间没有颜色),fitSystemWindows无法正常工作:
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">#19000000</item>
window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS)
Run Code Online (Sandbox Code Playgroud)
谢谢。
设法找到解决方案:
onCreate(在 Kotlin 中):
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
window.statusBarColor = Color.parseColor("#1A000000")
Run Code Online (Sandbox Code Playgroud)
样式.xml:
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3205 次 |
| 最近记录: |