【发布时间】:2020-09-19 14:51:24
【问题描述】:
在开发android时,我们通常在开发布局文件时使用xml。
示例)
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
...
当时我有一个疑问。 如何访问http://schemas.android.com/apk/res/android?
当我找到一些信息时。 我知道那不是 URL,而是 URI。所以不能通过互联网访问。那么命名空间信息在哪里呢?如何访问这些信息?
【问题讨论】:
-
你想在你的代码中访问RelativeLayout吗?
-
"如何访问schemas.android.com/apk/res/android?--你不知道。在那个 URL 上从来没有网页。"那么命名空间信息在哪里?" -- 你说的 " 是什么意思命名空间信息”?
-
命名空间定义了 XML 中的属性名称。如果您正在寻找有关它们使用的信息,您可以查看Android API reference 中的XML 属性 和Inherited XML 属性 部分。例如TextView#xml-attributes
标签: android xml android-layout xml-namespaces