title: Android TextView with multiple lines
body: <p>I want a TextView that should be broken into 4 lines. For e.g.</p>
  
  <pre><code>Vishal Vyas
    Having
     342
  Reputation
  </code></pre>
  
  <p>Note, the gravity should be <code>center_horizontal</code></p>
  
  <p>I tried following :</p>
  
  <pre><code>&lt;TextView
      android:gravity="center_horizontal"
      android:id="@+id/lblUserRep"
      android:layout_width="70dp"
      android:layout_height="wrap_content"
      android:lines="4"
      android:maxLines="4"
      android:text="VishalVyas Having 342 Reputation" &gt;
  &lt;/TextView&gt;
  </code></pre>
  
  <p>This works! but produces following output:</p>
  
  <pre><code>VishalVyas
    Having
     342
  Reputation
  </code></pre>
  
  <p><strong>Problems:</strong></p>
  
  <ol>
  <li>It doesn't work with the space between words Vishal and Vyas.</li>
  <li><code>android:layout_width="70dp"</code> is harcoded and there can be any name with n number of characters instead of <code>VishalVyas</code>.</li>
  </ol>
  
  <p>Please advice.</p>
  
  <p><strong>Added:</strong>
  It would be fine if I need to write a custom <code>TextView</code> for achieving this but I'll require some guidance.</p>
  
  <p>Thanks in advance.</p>