Microsoft.Maui.Graphics.Controls icon indicating copy to clipboard operation
Microsoft.Maui.Graphics.Controls copied to clipboard

[Bug] Controls don't layout properly horizontally

Open davidortinau opened this issue 4 years ago • 1 comments
trafficstars

I've used both HorizontalStackLayout and StackLayout with horizontal orientation, and in both cases the buttons are offscreen left.

<StackLayout Background="Red" Orientation="Horizontal">
                    <Button Text="Button"/>
                    <Button Text="Button" IsEnabled="False"/>
                </StackLayout>
image

Turning everything vertical lays out ok.

<Label Text="Primary filled"/>
                <StackLayout Orientation="Vertical">
                    <Button Text="Button"/>
                    <Button Text="Button" IsEnabled="False"/>
                </StackLayout>

                <VerticalStackLayout>
                    <Button ImageSource="{StaticResource CircleIcon}" Text="Button"/>
                    <Button ImageSource="{StaticResource CircleIcon}" Text="Button" IsEnabled="False"/>
                </VerticalStackLayout>

                <VerticalStackLayout>
                    <Button FontFamily="FontAwesome"
                            Text="{x:Static app:IconFont.Archway}"/>
                    <Button FontFamily="FontAwesome"
                            Text="{x:Static app:IconFont.Archway}"
                            IsEnabled="False"/>
                </VerticalStackLayout>
image

Build 9.217 Fluent

davidortinau avatar Oct 14 '21 20:10 davidortinau

I was able to work around this using Grid instead of StackLayout. Different layout objectives, but it did lay out horizontally properly, fwiw

RedChops avatar May 03 '22 15:05 RedChops