Default action bar elevation

2019-03-10 16:44发布

I want to use an elevation in a custom layout element and I want to set in XML the value of that element using the default action bar elevation value. I can't find a way to get it in XML and I'd like to avoid to call getElevation() in code. Any tips?

3条回答
贼婆χ
2楼-- · 2019-03-10 17:20

The standard elevation of the app bar is 4dp according to material design spec. Here is the link: https://material.io/guidelines/material-design/elevation-shadows.html#elevation-shadows-shadows

查看更多
Anthone
3楼-- · 2019-03-10 17:23

Default value is 8dp, create dimen with this value and use on whole project, I got it from sources, but the material design guidelines state the action bar elevation should be 4dp. enter image description here

查看更多
Juvenile、少年°
4楼-- · 2019-03-10 17:26

Here is the official resource available for the elevations.

查看更多
登录 后发表回答