0

我在 ViewFlipper 标记附近收到“根元素之后的文档中的标记必须格式正确”错误。该错误的原因是什么?

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

    <View android:id="@+id/gap" android:layout_width="wrap_content"
        android:layout_height="0dip" android:layout_alignParentBottom="true" />

    <RelativeLayout android:id="@+id/storage"
        android:layout_width="wrap_content" android:layout_height="wrap_content"
        android:layout_above="@id/gap" android:layout_marginBottom="10dp"
        android:layout_marginRight="27dp" android:layout_marginLeft="10dp"
        android:layout_toLeftOf="@id/bag" android:orientation="horizontal">

        <ImageButton android:id="@+id/ImageButton02"
            android:layout_width="wrap_content" android:layout_height="wrap_content"
            android:layout_alignTop="@+id/ImageButton01"
            android:layout_marginRight="16dp" android:layout_toLeftOf="@+id/ImageButton01"
            android:background="@drawable/key_stored" android:onClick="zoomImage" />

        <ImageButton android:id="@+id/ImageButton03"
            android:layout_width="wrap_content" android:layout_height="wrap_content"
            android:layout_alignTop="@+id/ImageButton01"
            android:layout_centerHorizontal="true" android:layout_marginRight="16dp"
            android:layout_toLeftOf="@+id/ImageButton02" android:background="@drawable/stool_stored"
            android:onClick="redSplashClicked" />

        <ImageButton android:id="@+id/ImageButton04"
            android:layout_width="wrap_content" android:layout_height="wrap_content"
            android:layout_alignTop="@+id/ImageButton01"
            android:layout_marginRight="16dp" android:layout_toLeftOf="@+id/ImageButton03"
            android:adjustViewBounds="true" android:background="@drawable/bottle_stored"
            android:onClick="redSplashClicked" />

        <ImageButton android:id="@+id/ImageButton05"
            android:layout_width="wrap_content" android:layout_height="wrap_content"
            android:layout_alignTop="@+id/ImageButton01"
            android:layout_marginRight="16dp" android:layout_toLeftOf="@+id/ImageButton04"
            android:adjustViewBounds="true" android:background="@drawable/key_stored"
            android:onClick="redSplashClicked" />

        <ImageButton android:id="@+id/ImageButton06"
            android:layout_width="wrap_content" android:layout_height="wrap_content"
            android:layout_alignTop="@+id/ImageButton01"
            android:layout_marginRight="16dp" android:layout_toLeftOf="@+id/ImageButton05"
            android:adjustViewBounds="true" android:background="@drawable/photo_stored"
            android:onClick="redSplashClicked" />

        <ImageButton android:id="@+id/ImageButton01"
            android:layout_width="wrap_content" android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentRight="true" android:background="@drawable/bottle_stored"
            android:onClick="store" />
    </RelativeLayout>
    <ImageButton android:id="@+id/bag" android:layout_width="65dp"
        android:layout_height="65dp" android:layout_alignBottom="@+id/storage"
        android:layout_alignParentRight="true" android:layout_marginRight="10dp"
        android:adjustViewBounds="true" android:onClick="redSplashClicked" />
    <ImageButton android:id="@+id/left" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:layout_alignLeft="@+id/storage"
        android:layout_centerVertical="true" android:background="@null"
        android:onClick="previousWall" android:src="@drawable/left" />
    <ImageButton android:id="@+id/right" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:layout_alignRight="@id/bag"
        android:layout_centerVertical="true" android:background="@null"
        android:onClick="nextWall" android:src="@drawable/right" />

</RelativeLayout>

<ViewFlipper android:id="@+id/water_room_flipper"
    android:layout_width="fill_parent" android:layout_height="fill_parent">
    <include layout="@layout/water_room_wall1" android:id="@+id/first" />
    <include layout="@layout/water_room_wall2" android:id="@+id/second" />
    <include layout="@layout/water_room_wall3" android:id="@+id/third" />
    <include layout="@layout/water_room_wall4" android:id="@+id/fourth" />
</ViewFlipper>

</RelativeLayout>
4

1 回答 1

0

我想通了。我在查看鳍状肢标签之前放置了不必要的结束标签。实际上我已经复制了xml并粘贴了。不知何故,结束标签自己出现了。

于 2013-10-17T16:05:42.757 回答