8

I want to display a string vertically in a view as below, is there have a way to implement that in layout XML file?

enter image description here

sunjinbo
  • 2,137
  • 4
  • 22
  • 45

2 Answers2

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"/>

Example image

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