Android 在对话框中设置textview的对齐方式
尝试将所有内容集中在对话框中。搜索栏居中,我使用的图像按钮居中,但无论我做什么,我似乎都无法将文本视图居中 以下是该对话框的代码:Android 在对话框中设置textview的对齐方式,android,Android,尝试将所有内容集中在对话框中。搜索栏居中,我使用的图像按钮居中,但无论我做什么,我似乎都无法将文本视图居中 以下是该对话框的代码: 在文本视图中使用android:gravity=“center” <TextView android:id="@+id/textView1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@str
在文本视图中使用android:gravity=“center”
<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" />