I've got a question about Xamarin Android GridLayout: How can I make spacing between the cells in a GridLayout? Thank you very much!
Asked
Active
Viewed 2,298 times
2 Answers
1
Are you using custom Views for each cell or are you creating all the cells in the layout file?
If you are creating all the cells in the layout file like in this example, you can use the android:padding attribute on each cell to add the amount of space you want to each element. If you are adapting custom views to the GridLayout, you can use attributes in the layout you are inflating like padding or layout_margin.

KSchau
- 11
- 2
-
I know this is old, but even adding margins in the custom view does not work for me. Everything is still bunched up together with no real spacing – New Guy Nov 01 '17 at 12:22
-1
You can use android:verticalSpacing and android:horizontalSpacing in your GridView to make spacing between the items. Check this answer here, it might help you:
Increase the grid spacing in android
Hope this solves your problem. Cheers!

Community
- 1
- 1

Cesar Tomatis
- 598
- 1
- 4
- 15
-
1No, it will not solve my problem because of using GridLayout, not gridview – Nikita Paimuhin Aug 11 '15 at 13:02