0

I have a GridView with 3 columns and 5 rows of images.

currently configureg like...

<GridView
    android:id="@+id/faces_gridview"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:numColumns="3" >
</GridView>

I want the images inside to resize themselves to fit 3x5 grid which is different in each phone. how can I tell the GridView to resize the images based on the grid size that I want ?

numColumns sets the columns but it does not reassure me that there will be 5 rows visible in the screen. I don't want to use a scroller.

Mohammed Azharuddin Shaikh
  • 41,633
  • 14
  • 96
  • 115
ufk
  • 30,912
  • 70
  • 235
  • 386

1 Answers1

1

as per GridView auto fit images & GridView not stretching to all screens

try

android:scaleType="fitXY" in image view 

and

 android:stretchMode="columnWidth" in grid view
Community
  • 1
  • 1
Dheeresh Singh
  • 15,643
  • 3
  • 38
  • 36