How to center a two-line text in a TextView on Android?

If you just want to center it (I'm assuming the n is working to split the lines), just add android:gravity="center_horizontal rather than layout_gravity Using layout gravity moves the actual TextView, using gravity affects the content of the TextView.

If you just want to center it (I'm assuming the \n is working to split the lines), just add android:gravity="center_horizontal rather than layout_gravity. Using layout gravity moves the actual TextView, using gravity affects the content of the TextView.

I think you must do it from Java: Then: TextView tv = (TextView) findViewById(R.id. The_text_view); tv. SetText(Html.

FromHtml("twolines")).

If you are using TableLayout make sure to set the gravity of the TableRows to center, too. Otherwise it will not work. At least it didn't work with me until I set the gravity of the TableRow to center.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions