Thanks**  MagouyaWare for your valuable reply....

On Thursday, 23 August 2012 17:00:42 UTC+5:30, Haris wrote:
>
> Hai all I am new in android programming.....
>
> 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....
>
>
> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android";
>     android:layout_width="match_parent"
>     android:layout_height="match_parent"
>     android:orientation="vertical" >
>
>     <TextView
>         android:id="@+id/testText"
>         android:layout_width="wrap_content"
>         android:layout_height="wrap_content"
>         android:textColor="#FFCC99"
>         android:textSize="24dp" />
>
>     <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" />
>
>     <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" />
>
>     <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" />
>
>     <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" />
>
> </RelativeLayout>
>
>
> Please help............
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to