繁体   English   中英

属性在listview上缺少Android名称空间前缀

[英]Attribute is missing Android namespace prefix on listview

我正在创建一个Android应用程序,它使用位于res文件夹下的schedule_layout.xml文件,但我收到此错误,“Android缺少Android名称空间前缀”。 这是什么意思? 我该如何解决?

<?xml version="1.0" encoding="utf-8"?>
<ListView
    android:id="@+id/schedule"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">
</ListView>

将以下属性添加到列表视图中:

"xmlns:android="http://schemas.android.com/apk/res/android"

它就像一个命名空间声明

使用以下

<?xml version="1.0" encoding="utf-8"?>
<ListView
    xmlns:android="http://schemas.android.com/apk/res/android" //missing
    android:id="@+id/schedule"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">
</ListView>

还检查一下

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM