StackLayout Spacing, Grid RowSpacing and ColumnSpacing default value to zero and not six
This suggestion is migrated to Developer Community. Please use below link to view the current status.
Xamarin Forms implements the spacing concept of CSS Box Model.
StackLayout Spacing, Grid RowSpacing and ColumnSpacing have a default value of six.
Developers need to know it to understand why empty columns and/or row takes extra space.
Moreover, is very annoying to set these properties explicitly to zero for every Grid and/or StackLayer in the XAML description of the page.
So please set the default value to zero for these properties.
Nicolò Carandini commented
Steve, when those mistery things happens, the easy solution is to add colored background to items. This way you can find clues that really help solving the issues. Related to this, I'm really happy with the new "live-reload" feature of Xamarin.Forms that let you experiment in a fraction of time of the old "change- compile-run" nightmare.
Steve Shaw commented
... and then there are the numerous posts where users wondered where this mysterious space was coming from. Is it a margin? a padding? who knows.
Steve Shaw commented
"forcing users to learn that immediately also sucked." - the problem is that there is no justification for any SPECIFIC chosen value. Therefore, it will almost always be the wrong value; you aren't doing even novice users any favors by misleading them. I even saw a post where a user thought whatever value they entered would be ADDED to the default, so they were asking what the default was, so they could enter "-6" to cancel the default of 6. Sorry, this was simply a mistake.
There is just no other way of saying it: a default Spacing value that you have to discover is not 0 was an incredibly bad idea. Just like unit tests are written to fail initially, a layout should be ugly initially. A default value of 6 violates the Rule of Least Astonishment.
I really like your idea, but absolutely understand why it was done the way it is.
There is an elegant way to reach, what you want, without chaning the Grid itself.
Just define a global implicit style for the grid, where you set the Spacings to zero.
Hope, this will help!
AdminXamarin (Product Owner, Xamarin) commented
This is not a defense of anything:
The original logic behind this was that without a default spacing things looked kind of nasty. Putting together basic pages tended to look really bad with things touching, however forcing users to learn that immediately also sucked.
In the future we are looking into a better solution that caters to both advanced users for whom this is not a great feature, and for introductory users who benefit from default spacings.
This will probably arrive the same time Margins do and be a global opt-in.
Dan Vanderboom commented
I agree. Default appearances should be as transparent, lookless, and non-assuming as possible.