Skip to content Skip to sidebar Skip to footer

Rotating Text In Android

I am creating an Android application. The design calls for rotated text as seen for the 'Physical Exam' label in the image below. I have used 'android:rotation='270'' but the layou

Solution 1:

If you are drawing to a canvas, you can use the translate() method to temporarily rotate the canvas, write to it, then translate it back.

More info at http://developer.android.com/reference/android/graphics/Canvas.html#translate(float,%20float)

Here is a good example: http://bestsiteinthemultiverse.com/2008/11/android-graphics-example/

Edit: Since you are handling this directly in the layout, here is a good solution from another Stackoverflow post: Vertical (rotated) label in Android

Solution 2:

You can try the following solution:

1. Using rotate in Animation:TextView Rotate Animation

2. Extend TextViewCustom TextView to rotate

Post a Comment for "Rotating Text In Android"