Android ImageView not stretching vertically in ListView row
<p>I have been struggling with this for several days now and I ran out of ideas. </p>

<p>In my listview, each row can have a vertical bar flushed left with a different color depending on status. That "bar" has no other purpose than visual representation of status and is not clickable.</p>

<p>I implemented the vertical bar using an ImageView with background set to a drawable which has the desired color. The problem is that the vertical bar doesn't stretch, it's only 1 pixel high even though I specified fill_parent.</p>

<p>The row layout is like this:</p>

<pre><code>&lt;RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" &gt;

    &lt;ImageView
        android:id="@+id/id1"
        android:scaleType="fitXY"
        android:layout_width="5dp"
        android:layout_height="fill_parent"
        android:background="@drawable/d1" /&gt;

    &lt;RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/id1"&gt;
...
</code></pre>

<p>(leaving content of the second relative layout out on purpose for simplicity)</p>

<p>My drawable d1 looks like this:</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;solid android:color="@color/c1" /&gt;
    &lt;corners android:topRightRadius="5dip" android:bottomLeftRadius="5dip" /&gt;
&lt;/shape&gt;
</code></pre>

<p>So,</p>

<ol>
<li>Why isn't the ImageView stretching vertically?</li>
<li>Is there a better way to implement
this than using an ImageView? (I
tried a simple View with a
background color but it doesn't show
up at all)</li>
</ol>

<p>Any help greatly appreciated. Thanks</p>
