0

I am trying to build Splash Screens the Right Way like this https://medium.com/@ssaurel/create-a-splash-screen-on-android-the-right-way-93d6fb444857 for that i have to place my app icon .png file inside a drawable layer list as bitmap like this

<item
    android:drawable="@color/gray"/>

<item>
    <bitmap
        android:gravity="center"
        android:src="@drawable/logo"/>
</item>

Now how can i resize this bitmap? Thanks...

1 Answers1

0

It is not possible to reset a new resize through XML, and you can confirm this link.

In the code method, there are different and complex methods. If you want to know more, you can look at this question

 

But if your goal is only to change the size, this can be done through ImageView

if you want full image set to your scree (best for splash screen) that use match_parent to image view , This method is easier and faster than other methods:

<RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent">


            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:scaleType="fitXY"
                android:layout_centerInParent="true"
                android:src="@drawable/splash_screen" />

        </RelativeLayout>
Adel B-Lahlouh
  • 1,059
  • 1
  • 8
  • 20