I created a xml file having 5 image buttons but when i run my app in my phone they are not in position with the background( i.e, not in the position i wanted). they acquire position which are little bit downwards then i expected. here is the code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/menuname1" >
<ImageButton
android:id="@+id/imageButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/imageButton1"
android:layout_centerHorizontal="true"
android:padding="50dp"
android:background="@drawable/i1" />
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="130dp"
android:background="@drawable/i2"
android:padding="65dp"
android:scaleType="fitCenter" />
<ImageButton
android:id="@+id/imageButton3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignTop="@+id/imageButton1"
android:layout_marginTop="15dp"
android:background="@drawable/i3"
android:padding="50dp"
android:scaleType="fitCenter" />
<ImageButton
android:id="@+id/imageButton4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/imageButton3"
android:background="@drawable/i4"
android:padding="50dp"
android:scaleType="fitCenter" />
<ImageButton
android:id="@+id/imageButton5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imageButton4"
android:layout_centerHorizontal="true"
android:padding="50dp"
android:scaleType="fitCenter"
android:background="@drawable/i5" />
</RelativeLayout>
EDIT: I want all the image buttons to be in relative to imageButton1(left of imageButton1 and no space between them) and imageButton1 should be in relative to the centre of the phone(not in exact center, just in relative to it). in my background i drew a separator which separates all the button in a stylish way but my buttons are not in relative to it. i want the button to be placed in a position 40% from bottom. can i do it.