我有這樣一個按鈕....Android:如何居中按鈕標題?
<Button
android:id="@+id/mark_button"
android:layout_width="wrap_content"
android:layout_height="33dp"
android:text="Note"
android:focusable="false"
android:gravity="center_horizontal|center_vertical" />
它有一個固定的大小,如果我測試的應用程序我的手機上的文字是沒有得到在按鈕的中心,所以文字的底部變切。看看這裏:Picture
你有什麼建議嗎?
我用的是非標準,Android的按鈕...我想這固定大小! – JavaNullPointer 2012-02-18 14:32:22
使用wrap_content的高度。而對於較小的按鈕使用屬性使用小尺寸。 – PravinCG 2012-02-18 14:34:04
我認爲字體大小與您的固定高度相比太大了... – 2012-02-18 14:34:12