Android GridView Layout

0

How to place rows between cells in a gridview. So it does not look like the items are floating. Example like columns and rows of an excel and if it is possible to change the color of some cell in a specific way.

    
asked by anonymous 03.07.2014 / 22:39

1 answer

1

The way I do this is very simple, fill the background of the GridView with a color, the items with another color and add the spacing between items, and there you have a grid with limits, table type. You can then combine these options to create beautiful effects.

Code sample SOEN :

GridView gv = findViewById(R.id.my_grid_view);
gv.setBackgroundColor(Color.WHITE);
gv.setVerticalSpacing(1);
gv.setHorizontalSpacing(1);
    
04.07.2014 / 11:00