Cris Cris - 1 year ago 154
Android Question

Layout problem with Android: rotated TextView

i'm building an Android app on which i have to represent data in a Table-like format.
So i'm using TableLayout; the problem is that i have to draw a rotated string like in the following raw example:

alt text

How can i create my layout to be able to show the '2011' rotated?

Thanks in advance and greetings !

Answer Source

Extend the TextView class and override the onDraw method.

protected void onDraw(Canvas canvas) {;
     canvas.rotate(90, xPivot, yPivot);

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download