title: Center image in android viewpager
body: <p>I have the ViewPager in the MainActivity, in every page is RelativeLayout, in the RelativeLayout is ImageView and TextView, I want the image and text in the center of the page.</p>
  
  <p>Something like this not working</p>
  
  <pre><code>android:layout_centerHorizontal="true"
  android:layout_centerVertical="true"
  </code></pre>
  
  <p>When I try a device with a really small size of the screen, the image with the text are in the bottom. </p>
  
  <p>ViewPager:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@color/abs__bright_foreground_disabled_holo_dark"&gt;
  &lt;android.support.v4.view.ViewPager
      android:id="@+id/viewPager"
      android:gravity="center"
      android:layout_width="match_parent"
      android:layout_marginTop="120dp"
      android:layout_marginBottom="120dp"
      android:layout_height="match_parent"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true"
      android:paddingLeft="0dp"
      android:paddingRight="0dp"
      android:layout_weight="1"&gt;
  &lt;/android.support.v4.view.ViewPager&gt;&lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>RelativeLayout:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="horizontal"
  android:id="@+id/hoo"&gt;
  
  &lt;ImageView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:id="@+id/imageSubject"
      android:layout_alignParentTop="true"
      android:layout_centerInParent="true"
      android:layout_marginTop="211dp"
      android:src="@drawable/abs__ab_bottom_solid_dark_holo"
      android:onClick="onClickSubject" /&gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:id="@+id/text"
      android:layout_below="@+id/imageSubject"
      android:layout_centerInParent="true"
      android:layout_marginTop="28dp" /&gt;&lt;/RelativeLayout&gt;
  </code></pre>