解决方案 »

  1.   

    你是新建的Untitled Text file吧?你要是新建xml文件的话Android xml file 
      

  2.   

    第一张图片是Android xml file,出现了这个问题
    第二章图片是我用txt转的xml,还是出现了这个问题搜索了很多问题但是没有类似的解决方案,
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >
        
    <LinearLayout
    报错点*  android: orientation="horizontal"
    android: layout_width="fill_parent"
    android: layout_height="wrap_content"> <TextView android: layout_width="wrap_content"
    android: layout_height="wrap_content"
    android: text="@string/title"/> <EditText android: id="@+id/title"
    android: layout_width="wrap_content"
    android: layout_height="wrap_content"
    android: layout_weight="1"/>
    </LinearLayout> <TextView android: layout_width="wrap_content"
    android: layout_height="wrap_content"
    android: text="@string/body"/> <EditText android: id="@+id/body"
    android: layout_width="fill_parent"
    android: layout_height="wrap_content"
    android: layout_weight="1"
    android: scrollbars="vertical"/> <Button android: id="@+id/confirm"
    android: text="@string/confirm"
    android: layout_width="wrap_content"
    android: layout_height="wrap_content"
    </LinearLayout>
    帮忙看一下我的结构有问题吗?或者是哪里打错的,thx!!
      

  3.   

    新建个android xml,然后把代码复制过去
      

  4.   

    我知道你哪里错了,比如 android:layout_width="wrap_content"    冒号之后有个空格,你把空格删了就好了。
      

  5.   

    今天我也遇到了这个问题。网上找了半天都没找到解决方案,但是我自己却找到了能改正确的方法。但是不知道原因。我用的代码是在word文档中拷贝的(老师给的),我直接复制过去,就会报错。我的解决方法是右键点击这个xml文件,然后new -> Android XML flie -> finish,就不报错了。我猜测,可能是因为eclipse中字符的编码和word中的不一样。