I have a problem while placing the buttons in my xml file.
Now what I want is that the "ok" button at the bottom should come below the mileage edit text that is at the second last strip. I am using a scroll view before the button. Also I am using a single image as a background.How is it possible that all my buttons in my application only come on the second last strip (gray color)? The rest of the layout should come in between (i.e. between top gray strip and the bottom gray strip).I tried using margin_top or margin_bottom in 'dp' but its not coming properly plus on every other phone the layout of button changes. Here is my code (.xml file):\[code\] <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/menu" androidadding="10dp"> <ScrollView android:id="@+id/scv" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="105dp" android:layout_marginBottom="105dp" > <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" > <EditText android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_marginTop="10dp" android:ems="10" android:hint="Year" android:inputType="date" /> <Spinner android:id="@+id/spinner1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/editText1" android:layout_alignRight="@+id/editText1" android:layout_below="@+id/editText1" android:layout_centerHorizontal="true" android:layout_marginTop="10dp" /> <Spinner android:id="@+id/spinner2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/spinner1" android:layout_alignRight="@+id/spinner1" android:layout_below="@+id/spinner1" android:layout_centerHorizontal="true" android:layout_marginTop="10dp" /> <Spinner android:id="@+id/spinner3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/spinner2" android:layout_alignRight="@+id/spinner2" android:layout_below="@+id/spinner2" android:layout_centerHorizontal="true" android:layout_marginTop="10dp" /> <EditText android:id="@+id/editText2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/spinner3" android:layout_below="@+id/spinner3" android:layout_centerHorizontal="true" android:layout_marginTop="10dp" android:ems="10" android:hint="Mileage" android:inputType="number" /> </RelativeLayout> </ScrollView> <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginBottom="10dp" android:text="OK" /> </RelativeLayout>\[/code\]