Android XML:android:elevation与app:elevation [英] Android XML: android:elevation vs. app:elevation

查看:415
本文介绍了Android XML:android:elevation与app:elevation的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

何时使用 android:elevation ,何时使用 app:elevation

这两者之间有什么区别?

What's the difference between those two?

推荐答案

希望我能帮上忙,让我们来看一个例子:

Hope I can help, Let's talk with an example:

<android.support.design.widget.FloatingActionButton
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    ...
    android:elevation="@dimen/elevation_medium"
    /> 

android:elevation 属性将在API级别21及更高版本中起作用。

The android:elevationattribute will work from the API level 21 and upper.

<android.support.design.widget.FloatingActionButton
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    ...
    app:elevation="@dimen/elevation_medium"
    /> 

在这种情况下, app:elevation 属性属于 FloatingActionButton 可设置样式的,位于 Android设计支持库,将从版本4的框架开始,而不是版本21的情况(对于 android:elevation )。

In this case the app:elevation attribute belongs to the FloatingActionButton styleable, inside de Android Design Support Library which will work from version 4 of the framework, instead version 21, the case of android:elevation.

这篇关于Android XML:android:elevation与app:elevation的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆