What features would you like to see added to Xamarin.Forms?

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.

62 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Nicolò CarandiniNicolò Carandini shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    4 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • EarlEarl commented  ·   ·  Flag as inappropriate

        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.

      • RusRus commented  ·   ·  Flag as inappropriate

        Hey Nicolò,

        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!
        Best regards,
        Rus

      • XamarinAdminXamarin (Admin, Xamarin) commented  ·   ·  Flag as inappropriate

        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.

      Feedback and Knowledge Base