How to make a text and center it in Android!

Hi everyone.

It’s really needed center a text on Android,and sometimes,it doesn’t format the text correctly,so i’m here to show a easy way to do it! In your XML file just put:

<TextView android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_horizontal" android:text="Here you should put your text!"  />

Yes,simple and useful,you could change your text settings,making it bold,italic, or just change the size of it. 

Advertisements

About barklome

This is angelox's (or barklome) personal blog. Talking about Embedded Linux things,Free Software Things,and tutorials about how-to-use free software.
This entry was posted in Android. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s