Appcompat v21 Toolbar elevation pre-lollipop

后端 未结 10 627
你的背包
你的背包 2020-12-23 13:33

First off, I know that this question has been asked before, but it hasn\'t been answered before. I hope someone can give me an answer.

In my application, I use the T

10条回答
  •  甜味超标
    2020-12-23 14:31

    You can't use the elevation attribute before API 21 (Android Lollipop). You can however add the shadow programmatically, for example using a custom view placed below the Toolbar.

    For example:

    
    

    Where the shadow is a drawable with a black gradient.

提交回复
热议问题