dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.22k stars 1.75k forks source link

MAUI FlexLayout incorrect height when wrapped #12648

Open vsfeedback opened 1 year ago

vsfeedback commented 1 year ago

This issue has been moved from a ticket on Developer Community.


[severity:I’m unable to use this version] Sometimes seen on Windows (seldom); always seen on Android Screenshot: (FlexLayout is yellow) maui.png

image

Xaml code:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage ...>
    <StackLayout Orientation="Vertical" Margin="20" HorizontalOptions="Center" Spacing="20">
        <Label Text="{local:Strings Key='ModeSelectionTitle'}" HorizontalTextAlignment="Center" />
        <Label Text="{local:Strings Key='ModeSelectionHint'}" HorizontalTextAlignment="Center" />
        <StackLayout Orientation="Vertical" BackgroundColor="AliceBlue" VerticalOptions="Fill">
            <FlexLayout Margin="20" Padding="20" MaximumWidthRequest="500" BackgroundColor="Yellow"
                        JustifyContent="Center" Wrap="Wrap" AlignContent="Center" AlignItems="Center" VerticalOptions="CenterAndExpand">
                <Button MinimumWidthRequest="100" Margin="20" Padding="20" VerticalOptions="Center"
                        x:Name="KeyboardButton" Text="{local:Strings Key='KeyboardMode'}"
                        Clicked="KeyboardButton_Clicked" />
                <Button MinimumWidthRequest="100" Margin="20" Padding="20" VerticalOptions="Center"
                        x:Name="TouchButton" Text="{local:Strings Key='TouchMode'}"
                        Clicked="TouchButton_Clicked" />
            </FlexLayout>
            <StackLayout Orientation="Horizontal"  HorizontalOptions="Center"
                         Margin="20" Padding="20" BackgroundColor="Wheat">
                <CheckBox x:Name="RememberBox" VerticalOptions="Center" />
                <Label x:Name="CheckboxLabel" Text="{local:Strings Key='RememberHint'}"
                       VerticalOptions="Center" HeightRequest="{Binding Source='RememberBox', Path='HeightRequest'}">
                    <Label.GestureRecognizers>
                        <TapGestureRecognizer Tapped="RememberLabel_Clicked" />
                    </Label.GestureRecognizers>
                </Label>
            </StackLayout>
        </StackLayout>
    </StackLayout>
</ContentPage>

Original Comments

Feedback Bot on 12/25/2022, 06:23 PM:

(private comment, text removed)


Original Solutions

(no solutions)

ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

Zhanglirong-Winnie commented 1 year ago

Verified this issue with Visual Studio Enterprise 17.7.0 Preview 2.0. Can repro on android platform with sample code. Screenshot 2023-07-03 151100