在 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"
/>
android
和 app
都有 contentInsetEnd
。
最佳答案
android
通常用于来自 Android SDK 本身的属性。
app
如果您使用支持库,则经常使用。
如果您使用自定义 View (您自己的或形成一个库),您也可能会看到其他命名空间。
这里有一些额外的信息:http://developer.android.com/training/custom-views/create-view.html#customattr
关于android - android : and app: prefix in Android XML? 之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29732512/