title: Apply Style to Android ListView
body: <p>I want to style the lisview in my application as seen is this image </p>
  
  <p><img src="https://i.stack.imgur.com/CEaJK.jpg" alt="Expected Output"></p>
  
  <p>I have tried to develop it by applying gradient :</p>
  
  <p>code for list_item_normal is :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;shape xmlns:android="http://schemas.android.com/apk/res/android"
      android:shape="rectangle" &gt;
  
      &lt;gradient
          android:centerColor="#E6E6E6"
          android:endColor="#CCCCCC"
          android:startColor="#FFFFFF" 
          android:angle="270"/&gt;
      &lt;!--
          &lt;gradient
          android:startColor="#FF7500"
          android:centerColor="#FFCC00"
          android:endColor="#FF7500"
          android:angle="270"/&gt;
      --&gt;
  
      &lt;stroke
          android:width="1dp"
          android:color="#A0000000" /&gt;
  
      &lt;padding
          android:bottom="8dp"
          android:left="5dp"
          android:right="5dp"
          android:top="8dp" /&gt;
  
      &lt;corners android:radius="5dp" /&gt;
  
  &lt;/shape&gt;
  </code></pre>
  
  <p>code for list_item_pressed.xml is :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;shape xmlns:android="http://schemas.android.com/apk/res/android" 
      android:shape="rectangle"&gt;
  
      &lt;gradient
          android:centerColor="#E6E6E6"
          android:endColor="#CCCCCC"
          android:startColor="#FFFFFF" android:angle="270"/&gt;
      &lt;!--
           &lt;gradient android:startColor="#FF66CFE6" android:centerColor="#FF207FB9" 
          android:endColor="#FF0060B8" android:angle="270"/&gt;
      --&gt;
  
      &lt;stroke
          android:width="2dp"
          android:color="#80000000" /&gt;
  
      &lt;padding
          android:bottom="8dp"
          android:left="5dp"
          android:right="5dp"
          android:top="8dp" /&gt;
  
      &lt;corners android:radius="7dp" /&gt;
  
  &lt;/shape&gt;
  </code></pre>
  
  <p>code for list_item_pressed.xml :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;shape xmlns:android="http://schemas.android.com/apk/res/android" 
      android:shape="rectangle"&gt;
  
      &lt;gradient
          android:centerColor="#E6E6E6"
          android:endColor="#CCCCCC"
          android:startColor="#FFFFFF" android:angle="270"/&gt;
      &lt;!--
           &lt;gradient android:startColor="#FF66CFE6" android:centerColor="#FF207FB9" 
          android:endColor="#FF0060B8" android:angle="270"/&gt;
      --&gt;
  
      &lt;stroke
          android:width="2dp"
          android:color="#80000000" /&gt;
  
      &lt;padding
          android:bottom="8dp"
          android:left="5dp"
          android:right="5dp"
          android:top="8dp" /&gt;
  
      &lt;corners android:radius="7dp" /&gt;
  
  &lt;/shape&gt;
  </code></pre>
  
  <p>and list_gradient.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
      &lt;item android:state_pressed="true"
            android:drawable="@drawable/list_item_pressed" /&gt;
  
      &lt;item android:state_focused="true"
            android:drawable="@drawable/list_item_selected" /&gt;
  
      &lt;item android:drawable="@drawable/list_item_normal" /&gt;
  
  &lt;/selector&gt;
  </code></pre>
  
  <p>and i have applied this style on <code>custom listitem</code> like :</p>
  
  <p>
  </p>
  
  <pre><code>&lt;TextView
      .../&gt;
  
  &lt;ImageView
     ... /&gt;
  </code></pre>
  
  <p></p>
  
  <p>and the main.xml in which i have lisview is :</p>
  
  <p>
  </p>
  
  <pre><code>&lt;ListView
      android:id="@+id/List"
      style="@style/list_item_gradient"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_weight="1"
      android:clickable="true" &gt;
  &lt;/ListView&gt;
  </code></pre>
  
  <p></p>
  
  <p>and i am getting output as shown below :</p>
  
  <p><img src="https://i.stack.imgur.com/wR2as.png" alt="current output"></p>
  
  <p>Please help me by telling what i am doing wrong..</p>
  
  <p>Thanks
  Shruti</p>