2013-07-27 55 views
1

我有以下XML文件:错误的xml文件

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/Scroll" 
    android:layout_width="match_parent"> 
    <RelativeLayout 
    android:id="@+id/contenedor" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" > 

    <LinearLayout android:id="@+id/cabecera" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:gravity="center" 
     android:orientation="vertical" 
     android:background="#CCCCFF" 
     > 

     <ImageView 
      android:id="@+id/icon" 
      android:src="@drawable/guliver" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
     /> 

    </LinearLayout> 

    <EditText android:id="@+id/edit_titulo_lugar" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginTop="100dp" 
     android:layout_marginLeft="50dp" 
     android:width="200dp" 
     android:hint="@string/titulo_lugar" 
     android:inputType="text" 
     /> 

    <EditText android:id="@+id/edit_descripcion_lugar" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginTop="170dp" 
     android:layout_marginLeft="50dp" 
     android:width="200dp" 
     android:hint="@string/descripcion_lugar" 
     android:inputType="text" 
     /> 

    <ImageButton 
      android:id="@+id/imgButton" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="260dp" 
      android:src="@drawable/camara1" 
     /> 

     <Button android:id="@+id/guardar" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_below="@+id/textedit" 
      android:text="@string/bguardar" 
      android:layout_marginTop="310dp" 
      android:layout_marginLeft="50dp" 
      /> 

     <Button android:id="@+id/cancelar" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_below="@+id/textedit" 
      android:text="@string/bcancelar" 
      android:layout_marginTop="310dp" 
      android:layout_marginLeft="200dp" 
      /> 

    </RelativeLayout> 
</ScrollView> 

当我尝试运行应用程序我有错误: 错误解析XML:绑定前缀的滚动型标签。

在互联网搜索后,我发现这个问题的几个答案,但我无法修复它。 我还输入了

<?xml version="1.0" encoding="utf-8"?> 

上面的ScrollView标签,但错误仍然存​​在。我也删除了xmlns字符串,但它不是解决方案。

怎么了?

谢谢。

+1

你有没有尝试清洁项目? – peshkira

+0

是的。在清理该项目的三个意图之后,最终确定了错误。 – axmug

+0

是“android:layout_below =”@ + id/textedit“导致您遇到问题吗?我没有在您提供的XML文件中看到名为”textedit“的XML元素。 – Demitrian

回答

1

您还没有指定属性android:layout_heightScrollView元素:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/Scroll" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" > 

</ScrollView> 
0

之前或之后android:layout_width只需添加

android:layout_height = "match_parent" 

ScrolView,你的问题应该消失。