2011-12-30 130 views
0

我想爲使用RelativeLayout的活動進行佈局。 我想實現的是:Android - 相對佈局

enter image description here

我有沒有麻煩& B:

<ImageButton 
       android:id="@+id/B" 
       android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_centerHorizontal="true" 
      android:background="@drawable/B" 
      android:layout_above="@+id/A" 
      android:layout_marginBottom="12dp" /> 
      <ImageButton 
       android:id="@+id/A" 
      android:layout_width="wrap_content" 
      android:layout_centerHorizontal="true" 
      android:layout_height="wrap_content" 
      android:layout_above="@+id/credit" 
      android:background="@drawable/A" 
      android:layout_alignParentBottom="true"/> 

我怎樣才能獲得C和d是一個上面和側面的B? (請注意,所有元素都居中,因此屏幕兩側都有空白)。

10x!

回答

0

我相信你可以使用android:layout_alignLeft="@id/B"例如對齊元素的左邊是在相同的位置元素B.左

或許C元素,你可以嘗試layout_above="@id/B"layout_alignLeft="@id/B"

+0

完善! 10X :) – 2011-12-30 01:06:40