关于Android xmlns [英] Regarding Android xmlns
问题描述
当我们在 Android 中开发布局时,所有 xml 文件都以
When we develop layouts in Android all the xml files begin with
xmlns:android="http://schemas.android.com/apk/res/android"
这有什么作用?为什么我的 xmlns 在开发应用程序时会引用网络中的链接?
What does this do and why for developing application my xmlns refers to a link in the web ?
PS:这是一个新手问题
PS : This is a newbie question
推荐答案
xmlns 是 xml 命名空间
xmlns is xml name space
命名空间由元素开始标记中的 xmlns 属性定义.命名空间声明具有以下语法.xmlns:prefix="URI".
The namespace is defined by the xmlns attribute in the start tag of an element. The namespace declaration has the following syntax. xmlns:prefix="URI".
xmlns:android
xmlns:android
定义 Android 命名空间.此属性应始终设置为 "http://schemas.android.com/apk/res/安卓".
Defines the Android namespace. This attribute should always be set to "http://schemas.android.com/apk/res/android".
http://www.w3schools.com/xml/xml_namespaces.asp
以下是类似问题的列表
为什么是这条线xmlns:android=http://schemas.android.com/apk/res/android"必须是布局xml文件中的第一个?
这篇关于关于Android xmlns的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!