2011-12-30 10 views
0

RelativeLayoutを使用してアクティビティのレイアウトを作成しようとしています。 私は何を達成しようとしていることはこれです:私は& Bと支障がないAndroid - 相対レイアウト

enter image description here

:私はCとDは上記と側面上にあるように取得できますか

<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"/> 

Bの? (すべての要素が中央に配置されているので、画面の両側に余白があることに注意してください)。

10x!

答えて

0

私はあなたがlayout_above="@id/B"layout_alignLeft="@id/B"

+0

を試みることができる要素Cのために、おそらく要素B.

の左と同じ位置にある要素の左側を揃えるために、例えばandroid:layout_alignLeft="@id/B"を使用することができると信じて完璧! 10X :) –

関連する問題