Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Imagebuttons not aligned as expected
    primarykey
    data
    text
    <p>I have a horizontal linear layout with four image buttons. Each image button has an image that is 64x64 pix and button's layout width is set at .25.<br> The images show up inside the button, but it is offset by a few pixels First button, aligned perfectly in the center Second button, offset towards the right Third button, further offset towards the right Fourth button, further offset and half the image flows outside of the button.</p> <p>I'm writing this based off of some other sample code where it was displayed perfectly. Any thoughts on what could be causing the issue?</p> <p><code></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="0"&gt; &lt;ImageButton android:src="@drawable/bt1" android:id="@+id/bt1" android:layout_width="match_parent" android:layout_weight=".25" android:layout_height="wrap_content"/&gt; &lt;ImageButton android:id="@+id/bt2" android:layout_height="wrap_content" android:layout_width="match_parent" android:layout_weight=".25" android:src="@drawable/bt2"/&gt; &lt;ImageButton android:id="@+id/bt3" android:layout_height="wrap_content" android:layout_width="match_parent" android:layout_weight=".25" android:src="@drawable/bt3"/&gt; &lt;ImageButton android:id="@+id/bt4" android:layout_height="wrap_content" android:layout_width="match_parent" android:src="@drawable/bt4" android:layout_weight="0.25"/&gt; &lt;/LinearLayout&gt; </code></pre> <p></code></p> <p>The styling is done like this: <code></p> <pre><code>&lt;item name="android:gravity"&gt;center&lt;/item&gt; &lt;item name="android:layout_width"&gt;wrap_content&lt;/item&gt; &lt;item name="android:layout_height"&gt;wrap_content&lt;/item&gt; </code></pre> <p></code></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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