在布局文件中找到意外的文本:"""

时间:2014-06-18 08:46:27

标签: android xml

我在1st AutoCompleteTextView上收到警告(在布局文件中找到意外的文字:""")。我认为相对布局存在问题,因为当我删除文本视图时,我得到了相同的错误,但不知道发生了什么... :(我已经尝试了很多但是很失望。请帮我解决这....这是我的xml代码:

 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>

<RelativeLayout

    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:layout_gravity="center"
    android:layout_marginLeft="15dp"
    android:layout_marginRight="15dp"

    >

    <TextView
        android:id="@+id/from"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/from"
        android:layout_marginTop="15dp"
        android:layout_centerHorizontal="true"
        android:textSize="20sp"
        android:textColor="#588810"/>



    <AutoCompleteTextView
         android:id="@+id/from_station"
         android:layout_below="@id/from"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"     
         android:layout_marginTop="15dp"
         android:hint="@string/hint_from"
         android:ems="10" >
    </AutoCompleteTextView>
   <TextView
        android:id="@+id/to"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="15dp"
        android:layout_below="@id/from_station"
        android:text="@string/to"
        android:layout_centerHorizontal="true"
        android:textSize="20sp"
        android:textColor="#588810"/>

   <AutoCompleteTextView
       android:id="@+id/to_station"
       android:layout_below="@id/to"
       android:layout_width="fill_parent"
       android:layout_height="wrap_content"
       android:layout_marginTop="15dp"
       android:hint="@string/hint_to"
       android:ems="0" 
       android:textColor="#588810">
   </AutoCompleteTextView>

</RelativeLayout>
  </ScrollView>

2 个答案:

答案 0 :(得分:5)

如果您正在使用Eclipse,那么下次只需清理您的项目:

项目→清洁

它已经解决了! ;)

答案 1 :(得分:1)

您似乎忘记关闭ScrollView:

   ...
   android:layout_marginTop="15dp"
   android:hint="@string/hint_to"
   android:ems="0" 
   android:textColor="#588810">
   </AutoCompleteTextView>

</ScrollView>
相关问题