GridView - sometimes rows are top-aligned, sometimes they're bottom-aligned!
<p>I am using a GridView. Four items in a column. Each element is composed of the following layout:</p>

<pre><code>&lt;LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:orientation="vertical"&gt;

  &lt;ImageView
    android:layout_width="32dip"
    android:layout_height="32dip"/&gt;

  &lt;TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textSize="11dip"
    android:paddingTop="2dip" /&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p>So each element is a small image with a bit of text below it. The layout works great on the first pass. However, if an item's text is long, it wraps to two lines. This works ok, until you scroll it in and out of view. By default, all the images in a row are top-aligned. When you scroll a row off-screen, then back on screen, you'll see that the row somehow gets bottom-aligned. It looks like:</p>

<p>First layout:</p>

<pre><code>[image]   [image]   [image]  
[text]    [text]    [text
                     wrap]
</code></pre>

<p>so even though the third element has 2 lines of text, the tops are aligned which is perfect. If I scroll this row off screen, then back on, it looks like this:</p>

<pre><code>                    [image]
[image]   [image]   [text
[text]    [text]     wrap]
</code></pre>

<p>so the row gets bottom-aligned here. I'm not sure if this is a bug in GridView, or if there's some way to control the layout to always top-align rows. I've tried setting the gravity of the element layout to "top", no good. There also doesn't appear to be any setting unique to GridView to control this. Any ideas?</p>

<p>Thanks</p>
