I am trying to get three buttons next to each other, the left one and right one are small ones, the middle one should fill up the rest of the width – 2x2dp (=margin).
I coded the following, but it keeps pushing my right button off screen, any ideas on how to solve this? There might be a way to privilige the left one and right one?
<RelativeLayout
android:id="@+id/rl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="10dp" >
<Button
android:id="@+id/bPreviousQuestion"
android:layout_width="42dp"
android:layout_height="42dp"
android:background="#c8c8c8"
android:text="<"
android:textColor="#ffffff"
android:textSize="20dp"
/>
<Button
android:id="@+id/bBack"
android:layout_width="fill_parent"
android:layout_height="42dp"
android:layout_toRightOf="@+id/bPreviousQuestion"
android:background="#c8c8c8"
android:text="Go Back"
android:textColor="#ffffff"
android:textSize="20dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp" />
<Button
android:id="@+id/bNextQuestion"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_toRightOf="@+id/bBack"
android:background="#c8c8c8"
android:text=">"
android:textColor="#ffffff"
android:textSize="20dp" />
</RelativeLayout>
Try adding:
to your “back” Button. In “next” remove this line:
And add: