Solution 1 :
you are doing it natively
while i have done it with the react native way
import React, { PureComponent } from "react";
import { Image, View } from "react-native";
import { Images, Metrics } from "@common";
import { Navigator } from "@services";
import styles from "./styles";
import SplashScreenComponent from "react-native-splash-screen";
const minDisplayTime = 1000;
class SplashScreen extends PureComponent {
componentDidMount() {
SplashScreenComponent.hide();
setTimeout(() => Navigator.navigate("AuthLoading"), 5000);
}
render() {
return (
<View style={styles.container}>
<Image
source={Images.splashGif}
style={{ width: '90%', borderWidth: 1, borderColor: '#fff' }}
resizeMode={"contain"}
/>
</View>
);
}
}
export default SplashScreen;
Problem :
I’m trying to make the logo in android splash screen scale correctly on different android devices.
I followed the instruction of npm react-native-splash-screen.
The splash screen logo scales well on iOS, but on Android it stretches out of screen like the following screenshot.
launch_screen.xml
in layout folder:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns_android="http://schemas.android.com/apk/res/android"
android_orientation="vertical" android_layout_width="match_parent"
android_layout_height="match_parent">
<ImageView android_layout_width="match_parent"
android_layout_height="match_parent"
android_src="@drawable/launch_screen"
android_scaleType="centerCrop" />
</RelativeLayout>
Android filter:
Project filter:
Comments
Comment posted by kaizen
Hi, is it possible to remove the default native splash screen?
Comment posted by medium.com/@appstud/…
@TamashiKaizen go through it maybe it might help you