title: Margin on ListView items in android
body: <p>I'm trying (in vain) to add margins to my ListView items. I have tried adding margin values to my RelativeLayout below but no matter what I do all I seem to get is a 1px line between each item.</p>
  
  <p>What I really would like is to have rounded corners on each item, a 1px black border and a 3-5px margin left, top, and right but right now I'll settle for just a margin around each item :-)</p>
  
  <p>How do I achieve my goals? Just the margin for now... ;-)</p>
  
  <p>Here's what I have:</p>
  
  <p><strong>UPDATE:</strong> I have updated the xml below removing main layout and fragment layout. I have also updated the ListView item layout to what I have now which is closer to what I want but still not perfect. Screenshot added as well</p>
  
  <p>listview item layout xml</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:paddingLeft="@dimen/matchMargin"
  android:paddingRight="@dimen/matchMargin"
  android:paddingTop="@dimen/matchMargin" &gt;
  
  &lt;RelativeLayout
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:background="#cfcfcfcf" &gt;
  
      &lt;include
          android:id="@+id/matchKampstart"
          layout="@layout/kampstart_layout" /&gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@id/matchKampstart"
          android:layout_marginTop="@dimen/belowKampstartMargin" &gt;
  
          &lt;ImageView
              android:id="@+id/tournamentImageView"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center_vertical"
              android:layout_marginRight="2dp"
              android:adjustViewBounds="true"
              android:contentDescription="@string/tournamentImageViewContentDescription"
              android:gravity="left"
              android:src="@drawable/sofabold_launcher" /&gt;
  
          &lt;ImageView
              android:id="@+id/homeTeamImageView"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center_vertical"
              android:layout_marginRight="2dp"
              android:adjustViewBounds="true"
              android:contentDescription="@string/homeTeamImageViewContentDescription"
              android:src="@drawable/sofabold_launcher" /&gt;
  
          &lt;TextView
              android:id="@+id/homeTeam"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center_vertical"
              android:layout_marginRight="2dp"
              android:text="@string/home"
              android:textSize="14sp"
              android:textStyle="bold" /&gt;
  
          &lt;TextView
              android:id="@+id/dash"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center_vertical"
              android:layout_marginRight="2dp"
              android:gravity="center"
              android:text="@string/dash"
              android:textSize="12sp"
              android:textStyle="bold" /&gt;
  
          &lt;ImageView
              android:id="@+id/awayTeamImageView"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center_vertical"
              android:layout_marginRight="2dp"
              android:adjustViewBounds="true"
              android:contentDescription="@string/awayTeamImageViewContentDescription"
              android:src="@drawable/sofabold_launcher" /&gt;
  
          &lt;TextView
              android:id="@+id/awayTeam"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center_vertical"
              android:gravity="center"
              android:text="@string/away"
              android:textSize="14sp"
              android:textStyle="bold" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:layout_below="@id/matchKampstart"
          android:layout_marginTop="@dimen/belowKampstartMargin" &gt;
  
          &lt;ImageView
              android:id="@+id/tvChannelImageView"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:adjustViewBounds="false"
              android:contentDescription="@string/tvChannelImageViewContentDescription"
              android:gravity="right"
              android:src="@drawable/sofabold_launcher" /&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/RelativeLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>This gives me the following where you'll notice a very small line to the right and left for each item. That I would also like to get rid of.</p>
  
  <p><img src="https://i.stack.imgur.com/xe70a.png" alt="enter image description here"></p>