Hello i have a button i want to put on a 45 degree angle. For some reason i cant get this to work. Can someone please provide code to accomplish this?
+4
A:
Extend the TextView class and override the onDraw method. Make sure the parent view is large enough to handle the rotated button without clipping it.
@Override
protected void onDraw(Canvas canvas) {
canvas.save();
canvas.rotate(45,<appropriate x pivot value>,<appropriate y pivot value>);
super.onDraw(canvas);
canvas.restore();
}
Ichorus
2009-12-19 03:15:42
Ok that sorta accomplish's what i want. I want the entire view itself to be on a 45 degree angle. Just not the text inside. But thank you for answering my question
Matthew
2009-12-20 16:39:07