Toolbar's shadow on status bar for Lollipop

前端 未结 5 1250
清歌不尽
清歌不尽 2020-12-15 08:55

I\'m using a template from Android Studio that used AppCompat Toolbar. Unfortunately, the toolbar casts shadow on the status bar so it doesn\'t

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-15 09:50

    That's because of :

    @android:color/transparent
    

    i guess.

    Got it, check this:

    http://developer.android.com/training/material/theme.html#StatusBar

    To set a custom color for the status bar, use the android:statusBarColor attribute when you extend the material theme. By default, android:statusBarColor inherits the value of android:colorPrimaryDark.

    And you've set it to transparent.this is not a good way for doing that since Google put this code for you:

    @color/colorPrimaryDark
    

    And also, instead of: