RelativeLayout margins inside a ListView are not displayed

android

Solution

If your margins just apply to the outer edges, try padding on the RelativeLayout instead.

Problem

I'm currently using a ListView that I fill with a custom adapter with RelativeLayout's. The problem is that the margins are not displayed for the RelativeLayout. Here is my relative layout declaration : ``` <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> ``` The ListView declaration : ``` <ListView android:id="@+id/ArticleSnippets" android:layout_width="fill_parent" android:layout_height="wrap_content" android:divider="#fff" android:dividerHeight="0sp"> </ListView> ``` Is there anything special to do to make the margin active inside a ListView ? Thanks in advance for any help, Lint (Dusariez JF)

Original source