Rotate image in RemoteViews?
I am creating an Androi开发者_JAVA技巧d widget. This widget has a ImageView on it. I would like to rotate the image in the ImageView - is there any way to do this (without manually creating new images in a desktop photo editor such as Photoshop and including them in the app)?
There is no direct way to do this for an ImageView
within a RemoteViews
. RemoteViews
in general is very limiting.
If your images can be a static resource, you can make a LevelListDrawable
in resource, and set each rotation as a level, then use RemoteViews
to invoke ImageView.setImageLevel()
with the appropriate index for 0/90/180/270 whatever.
If you are in a situation where you are drawing the image, you must re-draw it and re-send it to the RemoteViews
.
精彩评论