Here we are going to see about how to set textview alignment in Android.
It is very simple to set Android textview alignment to the center, right or left etc..
Example for Android textview alignment -
To align a textview we need to use the 'gravity' property
[sourcecode language="xml"]
<TextView android:text="@+id/TextView01"
android:id="@+id/TextView01"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:gravity="center" />
[/sourcecode]
Now we set the alignment to center