位图图像不清晰

时间:2019-11-12 16:26:45

标签: java android flutter png android-bitmap

我在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

1 个答案:

答案 0 :(得分:0)

正如@Michael Dougan所指出的那样,图像尺寸太小,与其将启动图像的一个版本保存在/res/drawable/中,不如将其保存为一个更好的图像(例如/res/mipmap-xxxhdpi