Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If not otherwise set, a GridView will override the layout you're imagining it should produce by stretching things in various ways. If you want to have full control of the layout by defining the column widths and the size of the grid items, then you have to make sure to set the GridView's <strong>stretchMode</strong> property to <strong>"none"</strong>.</p> <pre><code>&lt;GridView ... android:stretchMode="none"&gt; &lt;/GridView&gt; </code></pre> <p>Also, you are <strong>filling</strong> the parent with your GridView width. I think you should be <strong>wrapping</strong> the content for the width unless you want extra filling added. Where are you adding the 5dp padding? Around each bitmap or around the edge of the gridview? I don't see it.</p> <p>You should probably be filling the height though. (in the following some of the width and heights can probably be replaced by "wrap_content")</p> <p>So, for you</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;GridView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/imageGrid" android:stretchMode="none" android:layout_width="XXXdp" android:layout_height="fill_content" android:numColumns="6" /&gt; </code></pre> <p>Also, not sure if you need column spacing and width, which would be something like (or a dp instead of wrap_content) - you may not need these in your GridView - I'm not sure:</p> <pre><code> android:columnWidth="YYYdp" android:horizontalSpacing="0dp" </code></pre> <hr> <p>ImageViews with 5dp padding:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/grid_item_image" android:padding="5dp" android:layout_width="UUUdp" android:layout_height="VVVdp" /&gt; </code></pre>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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