【问题标题】:ViewFlipper in the relative layout along with another relative layout child. Non well formed markup相对布局中的 ViewFlipper 以及另一个相对布局子级。格式不正确的标记
【发布时间】:2013-10-26 05:33:13
【问题描述】:

我在 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>

【问题讨论】:

    标签: android layout android-relativelayout viewflipper non-well-formed


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-11-24
      • 2013-01-29
      • 2013-07-05
      • 1970-01-01
      • 2017-01-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多