关于Android xmlns [英] Regarding Android xmlns

查看:23
本文介绍了关于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"?在 XML 中是什么意思?

为什么是这条线xmlns:android=http://schemas.android.com/apk/res/android"必须是布局xml文件中的第一个?

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

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