-
-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android unique splash screen : how to make it fill screen? #131
Comments
@arnaudambro Hi. 👋 Sorry, but I don't see how is that an issue with the library, or a question about it? It's more a general question about Android development. Check #75 maybe. Also, don't use |
Hi @zoontek , I understand but I still ask my question here because I can't find any answer anywhere on the web... I tried so many combinations now, of android:gravity/bitmap/item/android:scaleType, and I am so desperate, just to fill a splash screen full screen ! It drives me crazy... |
@arnaudambro you can change the android:gravity to 'fill' like this:
` |
This doesn't keep the aspect ratio of the picture |
@arnaudambro I tried to recreate it yesterday too. Indeed, android seems not supporting This might explain why some apps splash screen is different between iOS and Android (Slack…) |
I almost succeeded by setting the params the following way: <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap
android:src="@drawable/splash"
android:gravity="center|bottom|clip_vertical"
/>
</item>
</layer-list> vertically it's OK, but horizontally the image is still a little bit stretched. |
@arnaudambro I think <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap
android:src="@drawable/splash"
android:gravity="center|bottom" <!-- or center|top / center|left / center|right -->
/>
</item>
</layer-list>
An alternative could be split the bitmap in multiple ones: https://developer.android.com/studio/write/draw9patch A bit complex for just a splash screen IMHO. |
i'm banging my head around the wall trying to figure out how to configure an imageview to keep the aspect ratio of an image and fill the display at the same time but it seems that examples of xml files (like the on in react-native-splash-screen) doesn't seem to work° |
I have a unique splash screen, called splash.png and sized 1280x1280, 150dp
My question is simple : how can I make my splash screen, in portrait mode, be full height, not less, not more, and keep its aspect ratio so that the picture fills the screen.
Like a
background-size: cover
in css.Or like an easy
<Image resizeMode="cover" style={{ height: '100%' }} />
in React Native.So I have :
android/app/src/main/res/values/styles.xml
android/app/src/main/res/drawable/bootsplash.xml
And my
splash.png
inandroid/app/src/main/res/drawable/splash.png
I tried a lot of things, a lot of combinations of
android:layout_height
,android:scaleType
and all, and I always end-up with a splash image's height overflowing the screen height.💻 My environment
The text was updated successfully, but these errors were encountered: