自己定义了一个com.example.platform.ProgressImageView,但是在代码中更换background和src都失败,下面是我定义的内容
<com.example.platform.ProgressImageView
android:id="@+id/k1"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginLeft="100dp"
android:background="@mipmap/xu" />
然后我尝试过用
ProgressImageView imageView
imageView .setImageURI()
还有
Resources resources = getContext().getResources();
Drawable imageDrawable = resources.getDrawable(R.mipmap.ti1);
imageView .setBackground(imageDrawable);
以及
imageView .setBackgroundResource(R.mipmap.ti1);
这几种方法,都无效,
请问怎么去更换背景图片呢,求好的方法