Default Spacing between items in a StackLayout?

JasonAwbreyJasonAwbrey USInsider, University, Developer Group Leader mod

I'm not sure if this is new behavior, or just something I haven't noticed before. I'm building a simple page with a StackLayout, and I expect the items in the layout to butt directly against one another. However, there is a gutter between them where you can see the background color of the StackLayout.

How can I control the size of the "gutter"?

            <StackLayout WidthRequest="150" BackgroundColor="Lime">
                <BoxView BackgroundColor="#959b8d" HeightRequest="30" />
                <BoxView BackgroundColor="#E1E2DD" HeightRequest="10" />
                <BoxView BackgroundColor="#959b8d" HeightRequest="30" />
                <BoxView BackgroundColor="#E1E2DD" HeightRequest="10" />
                <StackLayout HeightRequest="30" WidthRequest="200" HorizontalOptions="Center" BackgroundColor="#959b8d" Orientation="Horizontal" >
                    <Label FontSize="12" TextColor="Red" Text="Select" />
                    <Label FontSize="12" TextColor="Red" Text="Start" />
                </StackLayout>
                <BoxView BackgroundColor="#E1E2DD" HeightRequest="10" />
                <StackLayout BackgroundColor="White" WidthRequest="200" HeightRequest="50" Orientation="Horizontal">
                </StackLayout>
                <BoxView BackgroundColor="#E1E2DD" HeightRequest="10" />
                <BoxView BackgroundColor="#959b8d" HeightRequest="30" />
            </StackLayout>

Best Answer

Answers

  • JasonAwbreyJasonAwbrey USInsider, University, Developer Group Leader mod

    @JMarcus thanks, can't believe I haven't run into that before

  • Sometimes, Xamarin Forms feels like IE6 again... I have to reset Margin, Padding, Spacing, RowSpacing and ColSpacing all over the place :wink: Ah well...

  • And I am stuck inside this whirlpool

Sign In or Register to comment.