crazycodeboy / react-native-splash-screen

A splash screen for react-native, hide when application loaded ,it works on iOS and Android.
MIT License
5.61k stars 1.1k forks source link

Aspect ratio of image is not maintain in Google Pixel 2 #252

Open laxmikantchhipa opened 6 years ago

laxmikantchhipa commented 6 years ago

the aspect ratio of the image is not maintained if we using Linear layout as a parent of Splash screen

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/launch_screen">
</LinearLayout>

Change it to ImageView So user can maintain the aspect ratio of image and Use other property of ImageView

<ImageView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:scaleType="centerCrop"
        android:src="@drawable/launch_screen"
        >
    </ImageView>
ishigamii commented 6 years ago

@laxmikantchhipa this is not a question you should make a pull Request for it

For my part I am doing like this which is the same result I think :

<?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>
codingedgar commented 5 years ago

@laxmikantchhipa this is not a question you should make a pull Request for it

For my part I am doing like this which is the same result I think :

<?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>

Thank you 🙏