I want to display a string vertically in a view as below, is there have a way to implement that in layout XML file?
Asked
Active
Viewed 1.1k times
8
-
1http://stackoverflow.com/questions/2888780/is-it-possible-to-write-vertically-in-a-textview-in-android – kgandroid Sep 14 '16 at 11:34
-
http://stackoverflow.com/questions/1258275/vertical-rotated-label-in-android/7855852#7855852 – Aman Grover Sep 14 '16 at 11:40
-
have little fun with this tricky code.. **yourTextView.setRotation(-90);** – brahmy adigopula Sep 14 '16 at 11:43
2 Answers
17
To rotate the textview in xml use : android:rotation="-90"
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
android:rotation="-90"/>

Janishar Ali
- 376
- 3
- 8
1
add attributes in Text view android:rotation="-90"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:rotation="-90"
android:text="Hello World!" />

UJWAL GHONGADE
- 109
- 1
- 9