Skip to content

FlexLayout inside StackLayout does not adjust height #11708

@sschoeb

Description

@sschoeb

Description

Using a FlexLayout inside a StackLayout does not adjust the height of the FlexLayout.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="BugTestFlexlayout.MainPage">

    <StackLayout Orientation="Vertical">
        <Label Text="Hallo1"></Label>
        <FlexLayout>
            <Label Text="Hallo2"></Label>
            <Label Text="Hallo3"></Label>
        </FlexLayout>
        <Label Text="Hallo4"></Label>
    </StackLayout>
</ContentPage>

On my Android smartphone this looks like this:
image

The Labels for "Hallo2" and "Hallo3" are not visible.

Steps to Reproduce

  1. Create a new MAUI App
  2. Use the given XAML above
  3. Run the app on an Android phone

Link to public reproduction project repository

https://github.com/sschoeb/maui-flexlayout-issue

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

Android 13

Did you find any workaround?

No - FlexLayout is not usable inside a StackLayout

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions