I am filling a GridView
with pictures fetched from URL on a background Thread
. So while the images are loading, the TextView
below each image is already there, but the image has no width or height. The problem is that using DP is so confusing, I need the images to fill the 2 column grid and I don't know which size is best for it, that doesn't looks to large on lower resolution
Asked
Active
Viewed 132 times
0

Christopher Francisco
- 15,672
- 28
- 94
- 206
-
post your layout code, and perhaps a screen shot of what you are seeing and describe why it is undesireable. As your question stands now it is not very clear what your actual problem is. – FoamyGuy Jun 03 '13 at 21:16
1 Answers
1
If you want your gridview to have 2 columns, just use the stretchMode to set the width dynamically.
<GridView
android:id="@+id/gridview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:stretchMode="columnWidth"
android:numColumns="2"
/>
You may want to replace android:layout_width="match_parent"
by another value if you don't want the gridview to take all the super view's width.

lukasz
- 3,121
- 1
- 21
- 20