title: Android: how to place the text of a textview in the middle of its parent
body: <p>I've been looking for an answer reading other questions, but i 've not found exactly what i want.
  I have a <strong>TextView</strong> contained in a LinearLayout, with attributes <em>android:layout_height</em> and <em>android:layout_width</em> set to <em>match_parent</em>. </p>
  
  <pre><code> &lt;LinearLayout
          android:id="@+id/mylayout"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_centerHorizontal="true"
          android:orientation="vertical"&gt;
  
          &lt;TextView
              android:id="@+id/mytextview"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:gravity="center"
              android:singleLine="false"
              android:text="@string/mytext"
              android:textSize="@dimen/mytextsize" /&gt;
  
      &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I want the TextView text to start in the middle of the LinearLayout; I mean, to position the text vertically to the middle of the LinearLayout, but keeping <em>android:layout_height="match_parent"</em> in <strong>TextView</strong>.</p>
  
  <p>It is possible??</p>
  
  <p>In my java code in onCreate method I have this to get the middle point of the parent: </p>
  
  <pre><code>LinearLayout myLinearlayout = (LinearLayout) findViewById(R.id.mylayout);
  myLinearLayout.measure(MeasureSpec.UNSPECIFIED,MeasureSpec.UNSPECIFIED);
  int linearLayoutHeight = myLinearLayout.getMeasuredHeight();
  int middlePoint = linearLayoutHeight / 2;
  </code></pre>
  
  <p>Now, I dont know how to position the top line of the text in that point. Thanks</p>
  
  <p>** EDIT 1 **</p>
  
  <p>I forgot mention that the textview is scrollable, and the text is too long.</p>