Android的区别:应用程序和:在Android的XML preFIX? [英] Difference between android: and app: prefix in Android XML?

查看:169
本文介绍了Android的区别:应用程序和:在Android的XML preFIX?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么区别和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屋!

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