XML文件Android出现java错误(解析XML时出错:格式不正确(无效令牌))
所以我犯了这个错误,我知道这是一个常见的错误,但这个网站上的答案并没有帮助我
XML:
<ScrollView xmlns:安卓="http://schemas.安卓.com/apk/res/安卓"
xmlns:tools="http://schemas.安卓.com/tools"
安卓:layout_width="match_parent"
安卓:layout_height="match_parent"
安卓:paddingBottom="@dimen/activity_vertical_margin"
安卓:paddingLeft="@dimen/activity_horizontal_margin"
安卓:paddingRight="@dimen/activity_horizontal_margin"
安卓:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.app.LoginActivity" >
<RelativeLayout
安卓:layout_width="fill_parent"
安卓:layout_height="wrap_content"
安卓:background="#ffffff">
<!-- Header Starts-->
<LinearLayout
安卓:id="@+id/linear_layout_header_id"
安卓:layout_width="fill_parent"
安卓:layout_height="wrap_content"
安卓:background="@layout/header_gradient"
安卓:paddingTop="5dip"
安卓:paddingBottom="5dip">
<!-- Logo Start-->
<ImageView
安卓:layout_width="wrap_content"
安卓:layout_height="wrap_content"
安卓:src="@drawable/hd_logo"
安卓:layout_marginLeft="10dip"
安卓:layout_marginStart="10dip
/>
</LinearLayout>
<!-- Logo Ends -->
<!-- Header Ends -->
<!-- Footer Start -->
<LinearLayout
安卓:id="@+id/linear_layout_footer_id"
安卓:layout_width="fill_parent"
安卓:layout_height="90dip"
安卓:background="@layout/footer_repeat"
安卓:layout_alignParentBottom="true">
</LinearLayout>
<!-- Footer Ends -->
<!-- Login Form -->
<!-- Login Form Ends -->
</RelativeLayout>
</ScrollView>
所以我在LinearLayout </LinearLayout>
的结束标签上得到了Error parsing XML: not well-formed (invalid token)
。
另外ImageView
{
# 1 楼答案
你忘了收双引号了