title: Problem with 9 patch image as background
body: <p>I have a list view structure, with Relative layout that uses
  alternating background images for odd/even elements. I'm trying to set
  the background drawable dynamically by calculating the position. It
  worked fine with the normal bitmap. But when I tried to use the
  ninepatch image it breaks the UI, all the elements get distorted. What
  am I doing wrong? Could it be how the ninepatch image is created or is
  there a different way to use a ninepatch image compared to a normal
  bitmap.</p>
  
  <p>My List View XML goes like this</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content" android:id="@+id/id01"
         android:background="@drawable/my_9patch_bg_image"&gt;
         &lt;ImageView  /&gt;
         &lt;RelativeLayout&gt;
           &lt;ImageView  /&gt;
            &lt;TextView  /&gt;
            &lt;TextView  /&gt;
         &lt;/RelativeLayout&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <hr>
  
  <p>May be the solution <a href="https://stackoverflow.com/questions/3904852/android-layout-broken-with-9-patch-background">here</a> might work for my problem. It's exact though I have to try it. </p>