expo: [reopened] Splash Screen ResizeMode Contain Doesn't Work on Android
If I understand correctly the resizeMode docs, there must be a bug with the contain
setting on Android.
I’m running on Expo 23.0.0 with React 16.0.0. Here is my “splash” config:
{
"expo": {
"sdkVersion": "23.0.0",
"splash": {
"resizeMode": "contain",
"backgroundColor": "#ffffff",
"image": "./assets/icons/splash1.png",
},
}
}
I’m using this image for my test:
On iOS (iPhone X, 7, 6S) it works as expected:
However, on Android - it doesn’t “contain” the image. Here’s a screenshot from Android device (running on Android 7.1.2):
I tested on other Android devices and the result is the same.
The apps run on Expo Client, not as a standalone app yet, if that’s something that matters.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 6
- Comments: 16 (8 by maintainers)
Sadly, this fix does not seem to have properly affected the stand-alone android version. That is to say, the resizeMode flag works fine for me when using the expo client (per the fix), but reverts to the same issue discussed above when I create a stand-alone app for android.
I’m having the same issue. Works well on expo client but in the standalone app it appears in the ‘cover’ mode.
I’m having the same issue too!
My team also faced an issue, related to this. When building standalone build for android, the splash screen image became small. To fix it, team did as follows:
{ “expo”: { “name”: “testing” “platforms”: [“ios”, “android”], “splash”: { “resizeMode”: “cover”, “image”: “./assets/splashmdpi.png”, “backgroundColor”: “#000000” }, “ios”: { “bundleIdentifier”: “com.testing” }, “android”: { “package”: “com.testing”, “splash”: { “backgroundColor”: “#000000”, “image”: “./assets/splashmdpi.png”, “mdpi”: “./assets/splashmdpi.png”, “hdpi”: “./assets/splashhdpi.png”, “xhdpi”: “./assets/splashxhdpi.png”, “xxhdpi”: “./assets/splashxxhdpi.png” } }, “description”: “” } }
I followed: [dpi:(expected)]
mdpi: (640x960) hdpi: (252x450), xhdpi:(336x600), xxhdpi: (504x900), xxxhdpi: (672x1200)
for cropping image width and height accordingly.
@ifalldev to achieve the best results on Android you need to also configure
see here: https://docs.expo.io/versions/v27.0.0/guides/splash-screens#on-android-you-can-set-splash-images
hi! this is resolved now. please update your android client from the play store and in your simulator 😃 see https://blog.expo.io/expo-for-android-sdk23-minor-update-daf5847ae0a7