I have a multiline TextView in Android. It is a child of a LinearLayout. It is already centered horizontally and I also want to have the text inside it centered.
Here's what I have now:
_ _ _ _ _ _| aaaaaaaaaaaaaaaaaaaaa
_ _ _ _ _ _| aaaaaaaa
_ _ _ _ _ _| aaaaaaaaaaaaaa
What I want is:
_ _ _ _ _ _| aaaaaaaaaaaaaaaaaaaaa
_ _ _ _ _ _| aaaaaaaa
_ _ _ _ _ _| aaaaaaaaaaaaaa
Where:
_ _ _ _ = the space on the side of the TextView
| = the TextView edge
android:textAlignment="center"
see the detail solution here https://mcmap.net/q/40537/-how-do-i-center-text-horizontally-and-vertically-in-a-textview – Tumbler