I want a gridview with empty grid lines as follows
Here is what i got till now, gridview with gridlines in the occupied cells only. I want gridlines in empty cells also. Is this possible?
I want a gridview with empty grid lines as follows
Here is what i got till now, gridview with gridlines in the occupied cells only. I want gridlines in empty cells also. Is this possible?
I'm almost positive a GridView was never intended for this, so you have two options.
-Write your own GridView that supports a defaulted view.
OR
-If this is not a dynamic view that is changing all the time in real time:
In your adapter, set a minimum in your getCount method (return Math.max(actualSize, minimumCount)). And set the views with no data to your empty boxes.
Make sure the count is always some mod of 4 to ensure each row will be filled beyond that.
That's just what I'm coming up with on the top of my head, there's most likely a better way to do it, but hopefully I'm moving you in the right direction.
Try putting an empy View
within the empty cells of the grid.
For example, use a TextView
with no text, or simply a new View()
.