0

使用android:src="@mipmap/stunner在Android Studio的ImageView中加载图像时,我的图像变得模糊,该怎么办??请帮助...

我的代码如下:

<ImageView
    android:src="@mipmap/stunner"
    android:adjustViewBounds="true"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_margin="2dp"/>

我的 Android Studio 布局的屏幕截图

我要加载的图像

4

1 回答 1

1

请将其用作可绘制对象,而不是将其用作 mipmap。Mipmap 用于应用程序图标,但不用于可绘制对象

这是带有drawable的代码和输出

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/archive_task_open_btn"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:visibility="visible">

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="2dp"
        android:adjustViewBounds="true"
        android:src="@drawable/bg" />
</FrameLayout>

截屏

于 2018-08-05T07:59:57.040 回答