In my application I want to be able to rotate a view programmatically rather than via XML. I can easily create a <rotate/> drawable that references my Drawable, but I can not figure out how to do the same thing in Java. The problem is that many drawables in my scene can be displayed either vertically or horizontally and I do not want to have to create a separate rotate drawable for every drawable in my scene.
One thought I had was to instantiate a RotateDrawable in Java and then use that as the background for my view, but it does not appear that you can set the rotation of a RotateDrawable instantiated this way (you have to feed it XML to get it to be at all useful from what I can tell). Another thought I had was to rotate the canvas, but I would like to be able to use the drawables as view backgrounds and I do not see a way to rotate the canvas before the background of a view is drawn and then revert it afterwards. I also looked into creating some generic rotate drawable and then perhaps changing the drawable that it applies to, but that lead no where. So, does anyone have any ideas about how I can rotate a drawable in code and then use that rotated drawable as a background? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

