StackLayout Spacing, Grid RowSpacing and ColumnSpacing default value to zero and not six
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.
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 (Admin, 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.