Default action bar elevation

孤街醉人 提交于 2019-12-20 08:56:28

问题


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?


回答1:


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.




回答2:


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




回答3:


Here is the official resource available for the elevations.



来源:https://stackoverflow.com/questions/27568258/default-action-bar-elevation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!