不显示ListView内的RelativeLayout边距

Lin*_*nt_ 3 android

我目前正在使用ListView,我使用RelativeLayout来填充自定义适配器.问题是RelativeLayout没有显示边距.

这是我的相对布局声明:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/ArticleSnippet" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:padding="6dip" 
    android:layout_marginTop="10dip" 
    android:layout_marginLeft="10dip" 
    android:layout_marginRight="10dip" 
    android:background="@drawable/background_snippet" > 
    ... 
</RelativeLayout> 
Run Code Online (Sandbox Code Playgroud)

ListView声明:

<ListView 
    android:id="@+id/ArticleSnippets" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:divider="#fff" 
    android:dividerHeight="0sp"> 
</ListView> 
Run Code Online (Sandbox Code Playgroud)

有什么特别的事要做,以使ListView中的边距有效吗?

在此先感谢您的帮助,

林特(Dusariez JF)

Kir*_*man 5

如果边距仅适用于外边缘,请尝试在RelativeLayout上填充.