开发者

Rotate image in RemoteViews?

开发者 https://www.devze.com 2023-01-09 16:55 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消