【问题标题】:Error with XML file - Android(Error parsing XML: not well-formed (invalid token))XML 文件出错 - Android(解析 XML 时出错:格式不正确(无效令牌))
【发布时间】:2015-08-22 12:20:59
【问题描述】:

所以我收到了这个错误,我知道这是一个常见的错误,但这个网站上的答案都没有帮助我。

XML:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.app.LoginActivity" >

<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" 
    android:background="#ffffff">

    <!--  Header Starts-->
    <LinearLayout 
        android:id="@+id/linear_layout_header_id"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@layout/header_gradient"
        android:paddingTop="5dip"
        android:paddingBottom="5dip">

            <!-- Logo Start-->
            <ImageView 
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/hd_logo"
                android:layout_marginLeft="10dip"
                android:layout_marginStart="10dip
                />

    </LinearLayout>         
    <!-- Logo Ends -->
    <!--  Header Ends -->

    <!-- Footer Start -->
    <LinearLayout 
        android:id="@+id/linear_layout_footer_id"
        android:layout_width="fill_parent"
        android:layout_height="90dip"
        android:background="@layout/footer_repeat"
        android:layout_alignParentBottom="true">
    </LinearLayout>

    <!-- Footer Ends -->

    <!-- Login Form -->
    <!-- Login Form Ends -->

  </RelativeLayout>

</ScrollView>

所以我在 LinearLayout &lt;/LinearLayout&gt; 的结束标签上得到了 Error parsing XML: not well-formed (invalid token)ImageView /&gt; 的结束标签也是蓝色而不是绿色。 我做错了什么?

【问题讨论】:

    标签: java android xml android-linearlayout android-xml


    【解决方案1】:

    你忘了关闭双引号

    android:layout_marginStart="10dip"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多