属性缺少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>
有人能指出错误了吗?谢谢
答
您有:
<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缺少一个关闭"
答
尝试清洁您的解决方案,然后重新建立它。
那是整个布局XML吗? – 2013-04-26 13:36:21
清理你的项目并刷新你的日食 – 2013-04-26 13:37:39
yes..its整个xml文件..i没有刷新和干净,但无济于事 – Dhatri 2013-04-26 13:38:07