title: Android: How can I use the layer-list and shape elements to draw a horizontal rule when set as background?
body: <p>I want to set the background of a Relative or LinearLayout to a custom drawable. I want the shape to draw two horizontal lines across the bottom, leaving the central part transparent (empty).</p>
  <p>The following draws the horizontal lines centered vertically, where as I need them to be aligned to the bottom of the shape. (If you add a rectangle as an item you can see the shape expands to the dimenstions of the parent, but the lines are still centrally aligned).</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;layer-list xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; &gt;
   &lt;item&gt;
    &lt;shape android:shape=&quot;line&quot;&gt;
        &lt;stroke android:width=&quot;1dip&quot; android:color=&quot;#99b8b9bd&quot; /&gt;
        &lt;size android:height=&quot;1dip&quot; /&gt;
    &lt;/shape&gt;
   &lt;/item&gt;
   &lt;item&gt;
    &lt;shape android:shape=&quot;line&quot; android:top=&quot;1dip&quot;&gt;
        &lt;stroke android:width=&quot;1dip&quot; android:color=&quot;#FFFFFFFF&quot; /&gt;
        &lt;size android:height=&quot;1dip&quot; /&gt;
    &lt;/shape&gt;
   &lt;/item&gt;
  &lt;/layer-list&gt;
  </code></pre>