2011-05-10 85 views

回答

1
<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" android:layout_height="fill_parent"> 
    <TextView android:id="@+id/textView1" android:layout_width="wrap_content" 
     android:layout_height="wrap_content" android:text="SOME TEXT HERE" 
     android:layout_centerInParent="true" /> 
    <ImageButton android:src="@drawable/icon" android:id="@+id/imageButton1" 
     android:layout_width="wrap_content" android:layout_height="wrap_content" 
     android:layout_centerInParent="true" /> 
</RelativeLayout> 
+0

如果我需要有兩連勝按鈕和文本的意見? – Eugene 2011-05-10 12:01:53

+0

@AndroidNoob:對於更多的列將更正後的解決方案用'layout_weight =「1」包裝到'TableLayout'或'LinearLayout'中,孩子將是最好的選擇。 – rekaszeru 2011-05-10 12:04:56

+0

在@rekaszeru哈哈大聲笑我讀了他的筆記,因爲他字面上想要textview BELOW(z-index)textview。我猜它太早,我沒有足夠的咖啡。 – jkhouw1 2011-05-10 12:07:26

相關問題