开发者

What is the meaning of xmlns:android?

Why is everyone use http://schemas.android.com/apk/res/android ? Do I need sometimes to use something different that this url ? Who need this url ?, is something like package I mean what is the point with it

<?xml version="1.0" enco开发者_JS百科ding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"


xmlns defines an XML Namespace.

The URI that's used, even if it doesn't point to an existing resource, generaly points to (quoting) a resource under the control of the author or organisation defining the vocabulary.


For more informations, take a look at XML namespace.


Why is everyone use http://schemas.android.com/apk/res/android ?

Because that describes the namespace. It means that you can tell the difference between the orientation attribute used there, and an orientation attribute used in some other XML language.

Do I need sometimes to use something different

Yes. If you want to use elements or attributes from a different namespace.

that this url ?

It isn't a URL. It just looks like one to help avoid two people using the same name for their namespace.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜