Rotating a view in Android

Matthew picture Matthew · Dec 18, 2009 · Viewed 121.1k times · Source

I have a button that I want to put on a 45 degree angle. For some reason I can't get this to work.

Can someone please provide the code to accomplish this?

Answer

Jens Zalzala picture Jens Zalzala · Mar 9, 2012

API 11 added a setRotation() method to all views.