title: TextView not appearing correctly in Table layout
body: <p>The textview is not displaying text correctly. The text spans two lines, but the second line of text is only showing the text's upper half, as if the text is cut into 2 halves horizontally, despite using <code>height = wrap_content</code>.</p>
  
  <p><strong>xml code:</strong></p>
  
  <pre><code>    &lt;TableRow
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:paddingBottom="15dp"
          android:weightSum="1" &gt;
  
          &lt;TextView
              android:id="@+id/textView1"
              android:layout_width="0dp"
              android:layout_height="wrap_content"
              android:layout_weight="0.4"
              android:text="No. of direct Reportees:" /&gt;
  
          &lt;EditText
              android:id="@+id/direct"
              android:layout_width="0dp"
              android:layout_height="wrap_content"
              android:layout_weight="0.6"
              android:hint="Eg. 12"
              android:inputType="numberDecimal"
              android:textAppearance="?android:attr/textAppearanceSmall" &gt;
  
              &lt;requestFocus /&gt;
          &lt;/EditText&gt;
      &lt;/TableRow&gt;
  </code></pre>
  
  <p>SOLVED:</p>
  
  <p>This behavior is due to baseline alignment. The container has the correct height (it is the max of its two children) but the <code>Textview</code> is shifted down to be baseline aligned with the button. This behavior cannot be changed to preserve layouts in existing apps. The correct way to  implement this layout in your case is to add <code>android:baselineAligned="false"</code> on the <code>LinearLayout</code> tag. This will also get rid of the extra vertical space above the <code>TextView</code>.</p>