title: How to vertically align text within TextView
body: <p>I am trying to get some text vertically aligned within a TextView, but for some reason it just sticks to the top edge of such TextView.</p>
  
  <p>Trust me, I've read several questions here on Stack Overflow regarding the same, or similar, questions and tried applying the provided solutions, but nothing seems to make a change.</p>
  
  <p>For instance, what I thought would solve the issue right away was to add the attribute <code>android:gravity="center_vertical|left"</code>, but that didn't help either.</p>
  
  <p>This user's <a href="https://stackoverflow.com/questions/18724144/can%C2%B4t-center-textview%C2%B4s-text-vertically">question</a> describes almost exactly my issue, except that his TextView is inside a RelativeLayout which in turn is inside a ScrollView, which I don't (and don't need or want to) use. And the images he provided are also perfectly applicable to what I'm trying to <a href="https://i.imgur.com/WwHCegq.png" rel="nofollow noreferrer">describe</a> and <a href="https://i.imgur.com/9T8CyT6.png" rel="nofollow noreferrer">achieve</a>.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="horizontal"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:weightSum="2" &gt;
  
      &lt;ImageView
          android:id="@+id/account_server_icon"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:contentDescription="@string/account_server_icon"
          android:paddingLeft="16dp"
          android:gravity="left" /&gt;    
  
      &lt;TextView
          android:orientation="vertical"
          android:id="@+id/tv_account"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:paddingLeft="16dp"
          android:gravity="left|center_vertical" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>