vendredi 15 mai 2015

Position of image buttons changes while running

This is my XML file to place 5 buttons on the screen. When I was placing buttons on Android studio, it looked good, but when I debugged it on a small screen size phone, the positioning of the elements were not correct, the image buttons were overlapping each other

<ImageButton
    android:layout_width="wrap_content"
    android:adjustViewBounds="true"
    android:layout_height="wrap_content"
    android:id="@+id/imageButton1"
    android:src="@drawable/btn_01"
    android:layout_marginLeft="65dp"
    android:layout_marginTop="11dp"
    android:layout_below="@+id/txtReceive" />

<ImageButton
    android:layout_width="wrap_content"
    android:adjustViewBounds="true"
    android:layout_height="wrap_content"
    android:id="@+id/imageButton2"
    android:src="@drawable/btn_02"
    android:layout_marginLeft="52dp"
    android:layout_marginTop="50dp"
    android:layout_below="@+id/txtReceive"/>

<ImageButton
    android:layout_width="wrap_content"
    android:adjustViewBounds="true"
    android:layout_height="wrap_content"
    android:id="@+id/imageButton3"
    android:src="@drawable/btn_03"
    android:layout_marginLeft="52dp"
    android:layout_marginTop="92dp"
    android:layout_below="@+id/txtReceive" />

<ImageButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:adjustViewBounds="true"
    android:id="@+id/imageButton4"
    android:src="@drawable/btn_04"
    android:layout_marginLeft="62dp"
    android:layout_marginTop="135dp"
    android:layout_below="@+id/txtReceive" />

<ImageView
    android:layout_width="wrap_content"
    android:adjustViewBounds="true"
    android:layout_height="wrap_content"
    android:id="@+id/imageButton5"
    android:src="@drawable/send_btn"
    android:layout_marginLeft="165dp"
    android:layout_marginTop="55dp"
    android:layout_below="@+id/txtReceive" />

Aucun commentaire:

Enregistrer un commentaire