Transparent status bar not working with windowTranslucentNavigation=“false”

后端 未结 4 1475
悲&欢浪女
悲&欢浪女 2020-12-02 09:57

I am developing an Activity where I need to make the navigation bar opaque, and the status bar transparent on devices running 5.0+ (API 21+). The styles I am us

4条回答
  •  时光取名叫无心
    2020-12-02 10:23

    As far as I know there's no proper way to set the color of the status bar on APIs lower than 19.

    For API 19+ you can use a similar attribute to windowTranslucentNavigation only for the status bar:

    true
    

    Notes:

    • The reason you were getting a white status bar is because of

      @color/transparent 
      
    • There are some hacks that work on specific manufacturer devices, but I wouldn't use them myself.

提交回复
热议问题