Dave's Brain

Browse - Programming Tips - How can I horizontally center a TextView

Date: 2017mar8
OS: Android

Q.  How can I horizontally center a TextView

A.  

<TextView tools:textAlignment="center" // Center the text in the view android:layout_gravity="center_vertical" // Make the view centered />
Details omitted for clarity.

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.