2011-05-10 81 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

相关问题