属性缺少android特定命名空间

问题描述:

以下是main.xml的片段。虽然使用了android:layout_width,但它的Give属性缺失。属性缺少android特定命名空间

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:orientation="vertical" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" > 
    <TextView android:id="@+id/eventlabel" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginLeft="10px" 
     android:layout_weight="1" 
     android:paddingBottom="10px"/> 
</LinearLayout> 

有人能指出错误了吗?谢谢

+0

那是整个布局XML吗? – 2013-04-26 13:36:21

+0

清理你的项目并刷新你的日食 – 2013-04-26 13:37:39

+0

yes..its整个xml文件..i没有刷新和干净,但无济于事 – Dhatri 2013-04-26 13:38:07

您有:

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

将其更改为:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    <!-- rest is the same --> 

你只有xmlns=...而实际上并没有指明它的android部分。另外,您的tools XMLNS缺少一个关闭"

+0

其不是这样的错误张贴.. – Dhatri 2013-04-26 13:45:46

+0

@vindhya你完全无视我的第一点。将'xmlns =“http://schemas.android.com/apk/res/android”'更改为'xmlns:android =“http://schemas.android.com/apk/res/android”' – 2013-04-26 13:46:20

+0

非常感谢它工作 – Dhatri 2013-04-26 13:47:54

尝试清洁您的解决方案,然后重新建立它。