Android Studio开发,ImageView使用setBackgroundResource()更换背景之后,是图片叠在原来图片下面,怎么替换呢?


                <com.example.platform.ProgressImageView
                    android:id="@+id/k1"
                    android:layout_width="150dp"
                    android:layout_height="150dp"
                    android:layout_marginLeft="100dp"
                    android:background="@mipmap/xu1" /

这是定义的ImageView,在MainActivity中使用


image.setBackgroundResource(R.minmap.background);

但是效果是下面这样,是叠在一起的,不是替换,

img


请问有什么方法能把原来的图片去掉,替换成新图片呢?

image.setBackgroundResource(null);
image.setBackgroundResource(R.minmap.background);

你既然使用ImageView了,为啥不用src,反而要用背景?