Android的区别:应用程序和:在Android的XML preFIX? [英] Difference between android: and app: prefix in Android XML?
问题描述
有什么区别和Andriod的视图XML具有不同prefixes的更重要的是必要性?
What is the difference and more importantly the necessity of having different prefixes in Andriod view XML?
例如,
<android.support.v7.widget.Toolbar
android:id="@+id/actionToolBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentInsetEnd="20dp"
app:contentInsetEnd="20dp"
android:elevation="3dp"
/>
的 contentInsetEnd
为机器人
和应用
。
推荐答案
机器人
通常用于属性从Android SDK中本身。未来
android
is usually used for attribute coming from Android SDK itself.
应用
如果您使用的是支持库经常被使用。
app
is often used if you are using the support library.
您也可以(或您自己的形成库)看其他的命名空间,如果您使用的是自定义视图。
You may also see other namespaces if you are using custom views (of your own or form a library).
下面是一些额外的信息:<一href=\"http://developer.android.com/training/custom-views/create-view.html#customattr\">http://developer.android.com/training/custom-views/create-view.html#customattr
Here is some extra information: http://developer.android.com/training/custom-views/create-view.html#customattr
这篇关于Android的区别:应用程序和:在Android的XML preFIX?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!