title: TextView text aligment is horrible! How to work around it?
body: <p>I always seem to have the biggest issues with aligning a text on a layout.  Seems like the TextView doesn't measure its text properly.  The reported TextView width and height are a lot bigger than the actual text.  One would expect the TextView width and height to be tightly wrapped around the text.</p>
  
  <p>The image below shows how the number 18 and the text "SEC" are not aligning on the same bottom baseline.  This is due to the larger text height being a lot bigger than the text is. My xml layout can be seen below.</p>
  
  <p>How to achieve better text alignment accuracy?</p>
  
  <pre><code>&lt;RelativeLayout
      android:layout_width="fill_parent"
      android:layout_height="0dp"
      android:layout_weight="1"
      android:background="@drawable/scan_block_1_bg" &gt;
  
      &lt;LinearLayout
          android:id="@+id/staticCountDown"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerInParent="true"
          android:gravity="center"
          android:orientation="vertical" &gt;
  
          &lt;TextView
              android:id="@+id/tvStaticScanning"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:shadowColor="#ffffff"
              android:shadowDy="1.0"
              android:shadowRadius="0.01"
              android:text="SCANNING"
              android:textColor="#878787"
              android:textSize="20sp" /&gt;
  
          &lt;TextView
              android:id="@+id/tvCountDown"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:shadowColor="#66000000"
              android:shadowDy="-1.0"
              android:shadowRadius="0.01"
              android:text="03"
              android:textColor="#b6b6b6"
              android:textSize="81sp" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;TextView
          android:id="@+id/tvStaticSeconds"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBottom="@id/staticCountDown"
          android:layout_toRightOf="@id/staticCountDown"
          android:gravity="left"
          android:shadowColor="#ffffff"
          android:shadowDy="1.0"
          android:shadowRadius="0.01"
          android:text="SEC"
          android:textColor="#878787"
          android:textSize="12sp" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/OM1Il.png" alt="enter image description here"></p>