atom feed1 message in com.googlegroups.android-beginnersRe: [android-beginners] how to get te...
FromSent OnAttachments
Romain GuyJan 28, 2008 7:55 am 
Subject:Re: [android-beginners] how to get textview center align
From:Romain Guy (roma@google.com)
Date:Jan 28, 2008 7:55:11 am
List:com.googlegroups.android-beginners

Hi,

Replace android:layout_centerHorizontal="true" by android:textAlign="center". You could also used android:layout_width="wrap_content" and android:layout_gravity="center_horizontal".

On Jan 28, 2008 1:41 AM, Gautam Bisht <gaut@gmail.com> wrote:

hi all

i want to get Text View to be center align my xml file is like below but it not works

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/ android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">

<TextView id="@+id/version_view" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/version_text" android:textSize="16sp" android:typeface="normal" android:textStyle="bold" android:layout_centerHorizontal="true" />

</LinearLayout>

thanks gautam