I am using flutter_native_splash 1.3.1 package to add splash screen to the app.
The image size is getting displayed bigger than the desired size on the splash screen. What is right approach to decrease the size of the image on the splash screen?
I am using flutter_native_splash 1.3.1 package to add splash screen to the app.
The image size is getting displayed bigger than the desired size on the splash screen. What is right approach to decrease the size of the image on the splash screen?
I was having issues with this. I tried a lot of different suggestions from stackoverflow, but nothing worked. I eventually just added padding within the image around the logo I wanted to display. So the logo was about 1/3 of the image, centered in the middle and then used center for gravity
<bitmap android:gravity="center" android:src="@drawable/splash" />
The images are all called splash.png.
The images sizes were all squares and had the dimensions:
hdpi 192X192,
xhdpi 288X288,
xxhdpi 384X384,
xxxhdpi 1024X1024
Unfortunately, I don't think you can do it. So the option is to resize your image to fit your screen. You can read about the resolution in this topic https://github.com/jonbhanson/flutter_native_splash/issues/89
It is stated in the documentation that the image will be stretched to fit the screen. I think the best solution is to make your image with an aspect ratio of 9x16 (portrait) so the proportions stay the same.
As mentioned in the documentation:
image parameter
: By default, the launcher icon is used:
© 2022 - 2024 — McMap. All rights reserved.