1
我正在使用CircleImageView来制作圆形图像,但我想覆盖此图片的顶部。 Sicne设置CircleImageView
backgroundColor摆脱圆圈(将其填充为正方形)我有一个常规图像视图,并将其放在CircleImageView
之上,并将常规图像视图.setImageDrawable
设置为我想要的图片。但我需要在编程上将CircleImageView
的src设置为我目前拥有的和int的颜色。所以我想知道如何将CircleImageView
src设置为一种颜色?以编程方式设置ImageView SRC Android
我试图backgroundImage.setBackgroundResource(colorAsInt);
,但是这给了错误:android.content.res.Resources$NotFoundException: Resource ID #0xff7f0106
感谢
try backgroundImage.setBackgroundColor(Color.rgb(100,100,100)); – JRowan
@JRowan我无法设置backgroundColor,因为它从'CircleImageView'中移除了圆,只是填满了整个背景 – spenf10
尝试'backgroundImageImageView.setImageDrawable(new ColorDrawable(colorAsInt));',不知道它是否可以工作;我没有使用过这个库。 –