我在一个Activity中完成了这个操作,它完美地运行了。
ImageView myImage = (ImageView) findViewById(R.id.myImageView);
ShapeDrawable mDrawable;
mDrawable = new ShapeDrawable(new OvalShape());
mDrawable.getPaint().setColor(0xff74AC23);
mDrawable.setBounds(x, y, x + width, y + height);
mDrawable.setIntrinsicWidth(width);
mDrawable.setIntrinsicHeight(height);
myImage.setImageDrawable(mDrawable);
现在我想在一个小部件(位于
onUpdate
内部)中完成相同的事情,并且我必须使用RemoteViews
来访问图像。我该如何从
RemoteViews
调用ImageView
的setImageDrawable
?所有的远程视图方法似乎都需要一个Bitmap
。
setXYZ()
。最终我不得不发一个全新的问题:https://dev59.com/ymjWa4cB1Zd3GeqProtA。请看看你是否可以帮忙。 - harshit