How to make a TextView Text vertical

后端 未结 3 384
天涯浪人
天涯浪人 2021-01-19 05:04

I want a vertical label for my app. Is there a property to make text vertical? Here\'s what I mean vertical label:

S
t
a
c
k
o
v
e
r
f
l
o
w
相关标签:
3条回答
  • 2021-01-19 05:25

    Also another option if you only need one line of text and have a fixed-width typeface (monospace or Asian fonts):

    Limit the TextView width to fit just one character. The height can be wrap_content.

    0 讨论(0)
  • 2021-01-19 05:42

    Add \n after every letter. In the layout xml it won't appear right, but running it to an actual device or emulator will appear correct.

     <TextView
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:text="h\ne\nl\nl\no\n w\no\nr\nl\nd" />
    

    you can set the layout_height to wrap_content as well.

    0 讨论(0)
  • 2021-01-19 05:44

    A simple solution may be to insert a \n after each character, and make sure that the the height is set to fill_parent.

    0 讨论(0)
提交回复
热议问题