How to change the size of image in splash screen? How to change the size of image in splash screen? xml xml

How to change the size of image in splash screen?


I had the same issue but here is what I did.

I changed the "center" value to "fill"

that is

<item>    <bitmap android:gravity="fill" android:src="@drawable/splash" /></item>


Simple: create bigger logo files

I was also having the same problem, because my logo as you can in this print below, was very small:

Why?

Why the files that were in the "hdpi", "mdpi", "xhdpi", "xxhdpi", "xxxhdpi" folders respectively were in pixel sizes: 48, 72, 96, 144, 192, 512

How to fix?

Create bigger logo files

In my case, I doubled the pixel size of the files in the folders I mentioned above, so the "hdpi", "mdpi", "xhdpi", "xxhdpi", "xxxhdpi" folders were respectively pixel sizes: 88, 144, 192, 288, 384, 1024. And the result was this:


It seems to be possible in Android starting from API 23 by doing something like this:

    <item        android:gravity="center"        android:drawable="@drawable/logo_splash"        android:width="100dp"        android:height="100dp">

But I don't know how this will play with different resolutions and screens.

If you know a package or a way to solve it on Android and IOS it will be perfect. :)

There is a plugin that seems to do what you are looking for without the needs for you to configure both IOS & Android, please take a look at https://github.com/henriquearthur/flutter_native_splash

EDIT: Assuming from your question you are talking about a native splash screen, not just the initial page of your app.