Android 4.4 translucent Status and Navigation bars style on Android 5.0

前端 未结 3 541
悲&欢浪女
悲&欢浪女 2020-12-13 00:12

On Android 4.4 KitKat you can set the Status and Navigation bars transparent with the android:windowTranslucentStatus and android:windowTranslucentNavigat

3条回答
  •  天涯浪人
    2020-12-13 01:05

    To clarify @suckgamony's answer to this question:

    • Under Lollipop and above, setting android:statusBarColor or android:navigationBarColor to @android:color/transparent will make the Status Bar or Navigation Bar (respectively) completely transparent, unless:
    • android:windowTranslucentStatus or android:windowTranslucentNavigation is set to true, in which case the Status Bar or Navigation Bar (respectively) is set to the solid transparent color @AxeEffect describes (again, under Lollipop and above);
    • android:statusBarColor and android:navigationBarColor may only be used with Android version 21 (Lollipop 5.0) or higher. As described in the referred to answer, android:windowTranslucentStatus or android:windowTranslucentNavigation when used with Kitkat provide transparent gradients rather than full transparency.

提交回复
热议问题