title: TextView not properly in the center
body: <p>i want to place a <code>textview</code> in the center of a <code>linearlayout</code> but i am having problems with it. my <code>linearlayout</code> is match_parent in layout_width. <code>textview</code> is centered by assigning center to layout_gravity. <code>textview</code> is wrap_content in layout_width. here is my xml file</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@drawable/background"
      android:orientation="vertical" &gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content" &gt;
  
          &lt;TextView
              android:id="@+id/textView1"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center"
              android:text=" Text"
              android:textSize="40sp"
              android:textStyle="bold"
              android:typeface="monospace" /&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>