Android listview项目底部边距不工作

Android listview项目底部边距不工作,android,margin,expandablelistview,Android,Margin,Expandablelistview,我有一个可扩展的列表视图,如 <ExpandableListView android:id="@+id/expList" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/seperator" android:divi

我有一个可扩展的列表视图,如

 <ExpandableListView
    android:id="@+id/expList"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_below="@+id/seperator"
    android:divider="#ffededed"
    android:dividerHeight="0.0dip"
    android:groupIndicator="@null"
    android:listSelector="#ffededed" >
</ExpandableListView>

以及列表视图中的组项的布局

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="8dp"
    android:layout_marginRight="8dp"
    android:layout_marginBottom="8dp"
    android:background="@color/blue"
    android:padding="@dimen/common_padding" >

    <ImageView
        android:id="@+id/icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:importantForAccessibility="no"
        android:src="@drawable/ic_launcher" />

    <TextView
        android:id="@+id/name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/icon"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_toRightOf="@+id/icon" />
</RelativeLayout>


问题是,左、右和上页边距都在工作。但我找不到底边?请帮我把它弄清楚,因为我被这个问题困住了。

在默认的相对论的childs中,右上角对齐


尝试为您的孩子RelativeLayout设置android:layout\u alignParentBottom=“true”。

我的工作是将列表视图放在线性布局中

所以,从

<ListView
        android:id="@+id/xxxx"
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:textSize="@dimen/_40sdp"

        app:layout_behavior="@string/appbar_scrolling_view_behavior" />


问题解决了

    <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <ListView
        android:id="@+id/xxxx"
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:textSize="@dimen/_40sdp"

        app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</LinearLayout>