0

I'm developing an android app that contains two image buttons, these image buttons seem to be frameless or don't have bounds around them , look at the following figures:

enter image description here

instead, i want to make the buttons look like if they have bounds on their edges, like the following figure:

enter image description here

and that's my XML code:

 <LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="fill_parent"
    android:layout_gravity="center"
    android:layout_weight="1"
    android:orientation="horizontal" >

    <ImageButton
        android:contentDescription="@string/minus"
        android:id="@+id/mines"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_gravity="center"
        android:layout_weight="1"
        android:adjustViewBounds="true"
        android:padding="10dp"
        android:background="#21417D"
        android:scaleType="centerInside"
        android:src="@drawable/ac_button_minus" />

    <ImageButton
        android:contentDescription="@string/plus"
        android:id="@+id/plus"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_weight="1"
        android:adjustViewBounds="true"
        android:layout_marginRight="15dp"
        android:padding="10dp"
        android:background="#21417D"
        android:scaleType="centerInside"
        android:src="@drawable/ac_button_plus" />

</LinearLayout>
ScouseChris
  • 4,377
  • 32
  • 38
MRefaat
  • 515
  • 2
  • 8
  • 22

1 Answers1

0

If you just want the spacing between the buttons use the attribute android:layout_margin in your xml, you can specify individual sides too so e.g.

<ImageButton
 ...
 android:layout_marginLeft="16dp"
 ...
 android:scaleType="centerInside"
 android:src="@drawable/ac_button_minus" />
ScouseChris
  • 4,377
  • 32
  • 38