java - 位图图像未锐化

标签 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

最佳答案

正如 @Michael Dougan 所指出的,图像尺寸太小,最好将图像保存为不同尺寸,而不是在 /res/drawable/ 中保存启动图像的一个版本(例如/res/mipmap-xxxhdpi)

关于java - 位图图像未锐化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58822808/

相关文章:

regex - Flutter TextField inputFormatters 无法使用我的自定义正则表达式

google-maps - Flutter geolocator 包不检索位置

flutter - 如何防止 slider 弄乱我的布局?

java - 将参数传递给Java中的方法

java - Slick2D KeyListener 无法获取输入

java - Magento 类覆盖设计模式的正式名称?

android - 尝试调用 Messenger 时后台线程出现 NullPointerException

java - C# 中的 ByteBuffer.PutDouble 等价物

android - Android 中 3G 相邻小区的 cellID 和 LAC/PSC

android - 为什么当我打开其他应用程序时 ScheduledExecutorService 会停止