I am trying to make a layout for an activity using RelativeLayout.
What I am trying to achieve is this:

I have no trouble with A & 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"/>
How can I get C and D to be a above and on the sides of B? (Please Notice that all elements are centered, so there is margin on both sides of the screen).
10x!
I believe you can use
android:layout_alignLeft="@id/B"for example, to align the left of an element to be in the same position as the left of element B.Perhaps for element C you could try
layout_above="@id/B"andlayout_alignLeft="@id/B"