Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make frames to ImageButtons?
    text
    copied!<p>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:</p> <p><img src="https://i.stack.imgur.com/UkDBi.png" alt="enter image description here"></p> <p>instead, i want to make the buttons look like if they have bounds on their edges, like the following figure:</p> <p><img src="https://i.stack.imgur.com/lh1BN.png" alt="enter image description here"></p> <p>and that's my <strong>XML code:</strong></p> <pre><code> &lt;LinearLayout android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_gravity="center" android:layout_weight="1" android:orientation="horizontal" &gt; &lt;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" /&gt; &lt;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" /&gt; &lt;/LinearLayout&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload