xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

[Bug] Content inside Flexlayout not being rendered when wrap="reverse" #10910

Open feokuma opened 4 years ago

feokuma commented 4 years ago

Description

Trying to create a kind of toast of android, I used a Flexlayout inside the Stacklayout to control the height of the content. Using Wrap="Wrap" or Wrap="NoWrap" works but, when config with Wrap="Reverse" then content isn't renderer. Removing the Stacklayout then content is rendered but the height is automatically set to whole screen.

Maybe this issue might be related to https://github.com/xamarin/Xamarin.Forms/issues/9537

Steps to Reproduce

  1. Create a screen with the following code

    <Frame Padding="10"
           CornerRadius="10"
           Margin="10"
           BackgroundColor="Gray"
           VerticalOptions="End"
           HorizontalOptions="Center"
           HasShadow="False">
        <StackLayout >
            <FlexLayout Direction="Row"
                        Wrap="Wrap"
                        JustifyContent="SpaceBetween">
                <Label Text="Teste Label"
                       TextColor="Green"
                       BackgroundColor="LightGreen"/>
                <Label x:Name="xamarin"
                       Margin="0,5"
                       Text="Welcome to Xamarin.Forms!!!!!!"
                       TextColor="Blue"
                       BackgroundColor="LightBlue"
                       HorizontalOptions="EndAndExpand"
                       VerticalOptions="CenterAndExpand" />
            </FlexLayout>
        </StackLayout>
    </Frame>
  2. Change the property Wrap to Reverse

    <Frame Padding="10"
           CornerRadius="10"
           Margin="10"
           BackgroundColor="Gray"
           VerticalOptions="End"
           HorizontalOptions="Center"
           HasShadow="False">
        <StackLayout >
            <FlexLayout Direction="Row"
                        Wrap="Reverse"
                        JustifyContent="SpaceBetween">
                <Label Text="Teste Label"
                       TextColor="Green"
                       BackgroundColor="LightGreen"/>
                <Label x:Name="xamarin"
                       Margin="0,5"
                       Text="Welcome to Xamarin.Forms!!!!!!"
                       TextColor="Blue"
                       BackgroundColor="LightBlue"
                       HorizontalOptions="EndAndExpand"
                       VerticalOptions="CenterAndExpand" />
            </FlexLayout>
        </StackLayout>
    </Frame>

Expected Behavior

When set Wrap="Reverse" then blue text must be on the top

Expected Behavior

Actual Behavior

Screen using flexlayout with Wrap="Reverse" inside Stacklayout

Actual Behavior

Screen using flexlayout with Wrap="Reverse" without Stacklayout

Without Stacklayout

Basic Information

Reproduction Link

https://github.com/feokuma/FlexlayoutTest

Workaround

Xyotic commented 4 years ago

Happens to me as well..