title: Android unique splash screen : how to make it fill screen?
body: <p>I have a unique splash screen, called splash.png and sized 1280x1280, 150dpi
  I use <code>react-native-bootsplash</code> in my React Native project, but I don't think it really matters.</p>
  <p>My question is simple : how can I make my splash screen, in portrait mode, be full height, not less, <strong><em>not more</em></strong>, and keep its aspect ratio so that the picture fills the screen.
  Like a <code>background-size: cover</code> in css.
  Or like an easy <code>&lt;Image resizeMode=&quot;cover&quot; style={{ height: '100%' }} /&gt;</code> in React Native.</p>
  <p>So I have :</p>
  <p><code>android/app/src/main/res/values/styles.xml</code></p>
  <pre class="lang-xml prettyprint-override"><code>&lt;resources&gt;
  
      &lt;!-- Base application theme. --&gt;
      &lt;style name=&quot;AppTheme&quot; parent=&quot;Theme.AppCompat.Light.NoActionBar&quot;&gt;
          &lt;!-- Customize your theme here. --&gt;
          &lt;item name=&quot;android:textColor&quot;&gt;#000000&lt;/item&gt;
      &lt;/style&gt;
  
      &lt;!-- BootTheme should inherit from AppTheme --&gt;
      &lt;style name=&quot;BootTheme&quot; parent=&quot;AppTheme&quot;&gt;
          &lt;!-- set the generated bootsplash.xml drawable as activity background --&gt;
          &lt;item name=&quot;android:windowBackground&quot;&gt;@drawable/bootsplash&lt;/item&gt;
          &lt;item name=&quot;android:windowNoTitle&quot;&gt;true&lt;/item&gt;
      &lt;/style&gt;
  
  &lt;/resources&gt;
  </code></pre>
  <p><code>android/app/src/main/res/drawable/bootsplash.xml</code></p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;layer-list xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    android:orientation=&quot;vertical&quot;
    android:layout_width=&quot;fill_parent&quot;
    android:layout_height=&quot;fill_parent&quot;&gt;
      &lt;item&gt;
        &lt;!-- your logo, centered horizontally and vertically --&gt;
        &lt;bitmap
          android:layout_height=&quot;fill_parent&quot;
          android:src=&quot;@drawable/splash&quot;
          android:scaleType=&quot;centerInside&quot;
          android:gravity=&quot;center&quot; /&gt;
      &lt;/item&gt;
  &lt;/layer-list&gt;
  </code></pre>
  <p>And my <code>splash.png</code> in <code>android/app/src/main/res/drawable/splash.png</code></p>
  <p>I tried a lot of things, a lot of combinations of <a href="https://developer.android.com/guide/topics/ui/declaring-layout" rel="noreferrer"><code>android:layout_height</code></a>, <a href="https://developer.android.com/reference/android/widget/ImageView.ScaleType" rel="noreferrer"><code>android:scaleType</code></a> and all, and I always end-up with a splash image's height overflowing the screen height.</p>
  <p>[EDIT]
  Here is the splash original image, with the size reduced enough to have a small size for stackoverflow</p>
  <p><a href="https://i.stack.imgur.com/Hvim1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Hvim1.png" alt="splash original image" /></a></p>
  <p>and here is what it give on screen...</p>
  <p><a href="https://i.stack.imgur.com/sM1Eh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/sM1Eh.png" alt="stretched screen image" /></a></p>