Home > DeveloperSection > Forums > How do I center text horizontally and vertically in a TextView in Android?
ezra heywood
ezra heywood

Total Post:145

Posted on    May-19-2015 1:08 AM

 Android Android 

 1 Reply(s)
 475  View(s)
Rate this:
How do I center the text horizontally and vertically in a TextView in Android, so that it appears exactly in the middle of the TextView

Mayank Tripathi
Mayank Tripathi

Total Post:397

Posted on    May-19-2015 6:44 AM

in your TextView  tags xml
The textview has to be match_parent or fill_parent for this to work. If its wrap content, then it will not center.

Don't want to miss updates? Please click the below button!

Follow MindStick