本文主要是介绍android:elevation 属性, 5.0以上才可以用,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
android 官方api描述如下:
setElevation
void setElevation (View view, float elevation)
Sets the base elevation of this view, in pixels.
Parameters | |
---|---|
view | View |
elevation | float |
也就是一个设置高度的属性,方法。
但是必须与backgroud结合使用。
android:background
如下例子,否则没有悬浮高度的效果。
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="35dp" android:elevation="30dp" android:background="@android:color/holo_green_dark" android:text="Navigation Drawer" />
这篇关于android:elevation 属性, 5.0以上才可以用的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!