How can I add spacing in RelativeLayout
- by michael
Hi,
I have a Relative Layout.
Which has 2 buttons, side by side and it is right-aligned.
So this is my layout xml file. My question is there are no spacing between the right-most button and the right border of the RelativeLayout and between the 2 buttons. How can I add that? I play with android:paddingRight, but nothing helps.
Thank you.
<RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingLeft="0dp" android:paddingRight="10dp">
<Button android:id="@+id/1button" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:paddingLeft="10dp" android:paddingRight="10dp"/>
<Button android:id="@+id/1button" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/1button"
android:paddingLeft="10dp" android:paddingRight="10dp"/>