I have simple TextView
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:rotation="45"
android:text="Simple text" />
The text wont be rotated to 45 degree on Android 2.2.2.
I saw different threads, but everybody is doing an animation. I don't want to animate. All I want is to rotate the textview.
Create a custom TextView like this
and use
canvas.rotate(90)
where90
is the rotating angle.In android for any new view there is a method called setRotation(float) you can use it
but please note that this method is Added in API level 11
so if you want to support it you can use this
I found "android:rotation" is not work in SDK 21,in other words is Android 5.0. But i just found this problem in layout preview, not test in really device.