我在 Flutter 中添加了 Android 应用程序的启动图像。然而,该图像要么模糊,要么太大。当我查看硬盘上的图像时,它很清晰。如何保持图像清晰?
/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>
当前结果:screenshot
实际图像:logo
最佳答案
正如 @Michael Dougan 所指出的,图像尺寸太小,最好将图像保存为不同尺寸,而不是在 /res/drawable/
中保存启动图像的一个版本(例如/res/mipmap-xxxhdpi
)
关于java - 位图图像未锐化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58822808/