title: Center image view and text view in linear layout
body: <p>I want the search text below the search icon. The search icon + text group should be centered on the screen.</p>
  
  <p>What I <em>want</em>:____________What the screen <em>actually</em> looks like: </p>
  
  <p><a href="https://i.stack.imgur.com/sD7O0m.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sD7O0m.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/tyiOOm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tyiOOm.png" alt="enter image description here"></a></p>
  
  <p><strong>Note:</strong> I used Linear Layout because I need the List View directly underneath. It will be used for the search bar. For those suggesting using TextView's <code>android:drawableTop</code>, I tried that but the image is so small (even when I set the image to 500px) vs when I set the image as "100dpx100dp" in an image view.</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"&gt;
  
      &lt;android.support.constraint.ConstraintLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;ImageView
              android:id="@+id/imageView"
              android:layout_width="100dp"
              android:layout_height="100dp"
              android:layout_gravity="center_horizontal"
              app:srcCompat="@drawable/ic_search_gray_500px" /&gt;
  
          &lt;TextView
              android:id="@+id/searchTextView"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="@string/search_hint"
              android:layout_gravity="center_horizontal"
              tools:layout_editor_absoluteX="130dp"
              tools:text="@string/search_hint" /&gt;
  
      &lt;/android.support.constraint.ConstraintLayout&gt;
  
      &lt;ListView
          android:id="@android:id/list"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
  
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><a href="https://stackoverflow.com/a/25431178/7327018">Reference</a></p>