android - set the alignment of textview in a dialog -
trying center within dialog box. seekbars centered , the image buttons using cant seem textviews center not matter do.
here code dialog:
<textview android:id="@+id/textview1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/pick_color" android:textalignment="center" /> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <imagebutton android:layout_width="@dimen/large_brush" android:layout_height="@dimen/large_brush" android:layout_margin="2dp" android:background="#ff0000" android:layout_weight="1" android:tag="ff0000" /> <imagebutton android:layout_width="@dimen/large_brush" android:layout_height="@dimen/large_brush" android:layout_margin="2dp" android:background="#cc66ff" android:layout_weight="1" android:tag="cc66ff" /> <imagebutton android:layout_width="@dimen/large_brush" android:layout_height="@dimen/large_brush" android:layout_margin="2dp" android:background="#ffff66" android:layout_weight="1" android:tag="ffff66" /> <imagebutton android:layout_width="@dimen/large_brush" android:layout_height="@dimen/large_brush" android:layout_margin="2dp" android:background="#66ccff" android:layout_weight="1" android:tag="66ccff" /> <imagebutton android:layout_width="@dimen/large_brush" android:layout_height="@dimen/large_brush" android:layout_margin="2dp" android:background="#99ff33" android:layout_weight="1" android:tag="99ff33" /> <imagebutton android:layout_width="@dimen/large_brush" android:layout_height="@dimen/large_brush" android:layout_margin="2dp" android:background="#000000" android:layout_weight="1" android:tag="#000000" /> </linearlayout> <textview android:id="@+id/textview1" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/brsh_size" android:textalignment="center" /> <seekbar android:id="@+id/seekbar1" android:layout_width="match_parent" android:layout_height="wrap_content" /> <textview android:id="@+id/textview2" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/ersr_size" android:textalignment="center" /> <seekbar android:id="@+id/seekbar2" android:layout_width="match_parent" android:layout_height="wrap_content" /> <textview android:id="@+id/textview3" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/use_pic" android:textalignment="center" android:textappearance="?android:attr/textappearancelarge" />
use android:gravity="center" on text view
Comments
Post a Comment