1

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 layout doesn't work out right.

Does anyone have any suggestions on how to get the "Physical Exam" label to look like the image?

Physical Exam Label

Dan
  • 3,777
  • 4
  • 25
  • 23

2 Answers2

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

Community
  • 1
  • 1
Phil
  • 35,852
  • 23
  • 123
  • 164
1

You can try the following solution:

1. Using rotate in Animation: TextView Rotate Animation

2. Extend TextView Custom TextView to rotate

Community
  • 1
  • 1
NguyenDat
  • 4,129
  • 3
  • 46
  • 46