错误:解析XML时出错:标记不匹配

Har*_*son 3 xml xml-validation xml-parsing

我收到此错误:

解析XML时出错:标记不匹配.

如果有人知道如何解决这个问题,请你告诉我我缺少的东西,谢谢.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >


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

    <Button
        android:id="@+id/btnChangeImage"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Change Image" >

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

Guf*_*ffa 6

缺少<ImageView><Button>标签的结束标签.

您可以/在标记的末尾添加a 以使其自动关闭:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >


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

    <Button
        android:id="@+id/btnChangeImage"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Change Image" />

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)