【问题标题】:footer element hiding the last listview item隐藏最后一个列表视图项的页脚元素
【发布时间】:2015-03-14 15:08:47
【问题描述】:

我有一个带有 viewflipper、listview 和页脚元素的布局。每当呈现布局时,页脚元素都会隐藏最后一个列表视图项。

这是我的 xml 文件

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


    <ViewFlipper

        android:id="@+id/view_flipper"
        android:layout_width="fill_parent"
        android:layout_height="200dp"
        android:layout_alignParentTop="true"
        >

        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"

            >

            <ImageView
                android:id="@+id/frstim"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:src="@drawable/job"

                android:adjustViewBounds="true"
                android:scaleType="fitXY"
                />

   </RelativeLayout>

        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"

            >

            <ImageView
                android:id="@+id/scndim"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:src="@drawable/bg"

                android:adjustViewBounds="true"
                android:scaleType="fitXY"
                />


        </RelativeLayout>

        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"

            >

            <ImageView
                android:id="@+id/thrdima"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:src="@drawable/job"

                android:adjustViewBounds="true"
                android:scaleType="fitXY"
                />


        </RelativeLayout>

        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"

            >

            <ImageView
                android:id="@+id/furima"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"

                android:adjustViewBounds="true"
                android:scaleType="fitXY"
                android:src="@drawable/job"
                />


        </RelativeLayout>
    </ViewFlipper>





<ListView
    android:id="@+id/listview"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/view_flipper"
    />

<RelativeLayout
    android:background="@drawable/cell_shape"
    android:padding="2dp"
    android:layout_width="fill_parent"
    android:layout_height="100dp"
    android:layout_alignParentBottom="true"


    >
    <ImageView
        android:id="@+id/trus"
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:src="@drawable/trus"

        android:layout_alignParentLeft="true"
        />
    <ImageView
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:src="@drawable/fdelv"
        android:layout_centerInParent="true"
        />
    <ImageView
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:src="@drawable/csd"
        android:layout_alignParentRight="true"
        />


</RelativeLayout>

</RelativeLayout>

请指出哪里出错了

【问题讨论】:

    标签: android listview


    【解决方案1】:

    只需添加以下属性

    android:layout_below="@+id/...."
    android:layout_above="@+id/..."
    

    【讨论】:

      猜你喜欢
      • 2019-05-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-21
      • 1970-01-01
      • 2015-08-22
      • 2023-03-22
      相关资源
      最近更新 更多