title: Android center image and crop
body: <p>im with a problem related to android UI Design. </p>
  
  <p>This is what i want:
  <a href="https://i.imgur.com/a7DLo4x.jpg" rel="nofollow noreferrer">http://i.imgur.com/a7DLo4x.jpg</a></p>
  
  <p>This is what i have:
  <a href="https://i.imgur.com/AnL3cHT.jpg" rel="nofollow noreferrer">http://i.imgur.com/AnL3cHT.jpg</a></p>
  
  <p>I found a smiliar post about this, but their solution didnt help me:
  <a href="https://stackoverflow.com/questions/10679366/android-background-image-to-fill-screen">Android background Image to fill screen</a></p>
  
  <p>This is my XML code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fitsSystemWindows="true"
      android:alwaysDrawnWithCache="false"&gt;
  
      &lt;ImageView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:id="@+id/imageView"
          android:scaleType="center"
          android:background="@drawable/bg" /&gt;
  
  
     &lt;!-- &lt;ImageView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:id="@+id/logoImage"
          android:layout_gravity="center_horizontal"
          android:background="@drawable/logo"
          android:layout_centerVertical="true"
          android:layout_centerHorizontal="true" /&gt;
  --&gt;
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="30dp"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:text="Login"
          android:id="@+id/loginBt"
          android:layout_below="@+id/logoImage"
          android:layout_alignStart="@+id/logoImage"
          android:layout_marginTop="5dp" /&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="30dp"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:text="Register"
          android:id="@+id/registerBt"
          android:layout_alignBottom="@+id/loginBt"
          android:layout_alignRight="@+id/loginBt"
          android:layout_alignEnd="@+id/logoImage"
          android:layout_marginTop="5dp" /&gt;
  
      &lt;FrameLayout
          android:id="@+id/loginFragment"
          android:layout_width="fill_parent"
          android:layout_height="match_parent"&gt;
  
      &lt;/FrameLayout&gt;
  
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I also tried to use android:scaleType="centerCrop"</p>
  
  <p>Thanks for your time.</p>