I'm including a launch image for my android application in Flutter. However this image is either blurry or too big. When I view the image on my hard drive it is sharp. How can I keep the image sharp?
/res/drawable/launch_background.xml:
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/background" />
<item>
<bitmap
android:gravity="center"
android:src="@drawable/icon_transparent_256" />
</item>
</layer-list>
/res/values/styles.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
</resources>
current result: screenshot
actual image: logo
As @Michael Dougan pointed out, the image size was too small and instead of saving one version of the launch image in /res/drawable/
, it is better so save the image in different sizes (eg /res/mipmap-xxxhdpi
)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.