Android button position changes while the screen rotating
<p>Hai all I am new in android programming.....</p>

<p>For my application I am using image button and it successfully installed on the device.
But when I rotate the screen all the button position get changed...
and I need all the button placed at centre of the screen....
And here is my code....</p>

<p>

<pre><code>    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" &gt;

    &lt;TextView
        android:id="@+id/testText"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="#FFCC99"
        android:textSize="24dp" /&gt;

    &lt;ImageButton
        android:id="@+id/up"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_marginRight="124dp"
        android:layout_marginTop="80dp"
        android:src="@drawable/up" /&gt;

    &lt;ImageButton
        android:id="@+id/left"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_below="@+id/up"
        android:layout_marginRight="200dp"
        android:layout_marginTop="150dp"

        android:src="@drawable/left" /&gt;

please help.......

    &lt;ImageButton
        android:id="@+id/right"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_below="@+id/up"
        android:layout_marginRight="50dp"
        android:layout_marginTop="150dp"
        android:src="@drawable/right" /&gt;

    &lt;ImageButton
        android:id="@+id/down"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/up"
        android:layout_alignParentRight="true"
        android:layout_marginRight="124dp"
        android:layout_marginTop="80dp"
        android:src="@drawable/down" /&gt;

&lt;/RelativeLayout&gt;
</code></pre>
