Grid images will not be resized correctly in Android

I am working in an android application. In this I need to create a screen using a GridView. In my case, the grid images are not aligned correctly. I am showing a gridview inside a fragment.

I want to arrange images in 3 column format * 5 rows (without scrolling)

And I use 512 * 512 pixels png format image

+3
source share
1 answer

You can define rows and columns like this.

    android:columnCount="5"
    android:rowCount="3"

or you can do it programmatically like

 gridview.setNumColumns(nmrOfColums);
 gridview.setNumRows(nmrOfRows);
+1
source

Source: https://habr.com/ru/post/1696250/


All Articles