添加到可绘制文件夹中的普通图像不会在三星设备中显示 - Android

Common image added in drawable folder doesn't get displayed in Samsung device - Android

我有一张大小为 1.2MB、尺寸为 2436 * 1539 的图片。 我已将此图像添加到单个 drawable 文件夹中,而不是将其添加到不同的可绘制文件夹中 (drawable-hdpi, drawable-xdpi, drawable-xxdpi, drawable-xxxdpi).

当我 运行 我的应用程序在 Samsung SM-G7102 设备中时,图像无法显示。这些设备使用 xhdpi 个图像。它也会显示在所有其他设备上。

但是当我在 drawable-xxxhdpi 文件夹中添加图像时,它也适用于此 Samsung SM-G7102 设备。

正如我们在 xxxhdpi Android 中添加图像后所知 运行time down 对所有 dpi 设备进行采样。 但我的问题是为什么将它添加到简单的 drawable 文件夹中不起作用?

如有任何帮助,我们将不胜感激。 提前致谢。

以下是我的.xml设置图片的代码:

<android.support.constraint.ConstraintLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">
        <android.support.v7.widget.AppCompatImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="fitXY"
        android:src="@drawable/background_image" />
</android.support.constraint.ConstraintLayout>

res/drawable/ 是旧目录,相当于 res/drawable-mdpi/.

Android,因此,在将图像加载到 -xhdpi 设备时会放大图像。这是每个维度增加 2 倍,因此您生成的图像将是 4872 * 3078。作为 ARGB_8888 图像,大约 57MB,您可能 运行 内存不足。