Repository navigation
Closed
Labels
area-layoutStackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenterfixed-in-7.0.100fixed-in-7.0.101fixed-in-7.0.81Look for this fix in 7.0.81!fixed-in-8.0.0-preview.1.7762Look for this fix in 8.0.0-preview.1.7762!i/regressionThis issue described a confirmed regression on a currently supported versionlayout-flexFlexLayout issuesplatform/androidt/bugSomething isn't working
Milestone
Description
Description
Prior to upgrading VS2022 Preview yesterday, the FlexLayout implemented in my code was working 100%. Since the changes, the FlexLayout does not render properly. Instead of displaying like a grid, it is now overlapped and displays in rows.
Steps to Reproduce
Create a new MAUI project and target only Android 13 (v33).
Replace the ContentPage with the exact code I tested with:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="MauiTestBench.MainPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<ContentPage.Resources>
<ResourceDictionary>
<!-- Start Tile Styling -->
<Style x:Key="TileStyle" TargetType="Frame">
<Setter Property="Padding" Value="0,0,0,0" />
<Setter Property="Margin" Value="0,20,0,20" />
<Setter Property="BorderColor" Value="LightBlue" />
<Setter Property="CornerRadius" Value="15" />
<Setter Property="HasShadow" Value="True" />
<Setter Property="HeightRequest" Value="120" />
<Setter Property="WidthRequest" Value="120" />
<Setter Property="MinimumHeightRequest" Value="100" />
<Setter Property="MinimumWidthRequest" Value="100" />
<Setter Property="HorizontalOptions" Value="CenterAndExpand" />
<Setter Property="VerticalOptions" Value="CenterAndExpand" />
</Style>
<Style x:Key="TileImageStyle" TargetType="Image">
<Setter Property="HeightRequest" Value="50" />
<Setter Property="WidthRequest" Value="50" />
<Setter Property="Margin" Value="5" />
</Style>
<Style x:Key="TileLabelStyle" TargetType="Label">
<Setter Property="FontAutoScalingEnabled" Value="True" />
<Setter Property="FontSize" Value="Default" />
<Setter Property="HorizontalTextAlignment" Value="Center" />
<Setter Property="TextColor" Value="Black" />
<Setter Property="TextTransform" Value="Uppercase" />
<Setter Property="FontFamily" Value="QuicksandRegular" />
<Setter Property="FontSize" Value="Small" />
</Style>
<!-- End Tile Styling -->
</ResourceDictionary>
</ContentPage.Resources>
<ScrollView>
<FlexLayout
x:Name="FlexTiles"
AlignItems="Stretch"
Direction="Row"
JustifyContent="SpaceEvenly"
VerticalOptions="Start"
Wrap="Wrap">
<!-- ROSTERS TILE -->
<Frame Style="{DynamicResource TileStyle}">
<StackLayout HorizontalOptions="Center" VerticalOptions="Center">
<Image Style="{DynamicResource TileImageStyle}" />
<Label Style="{DynamicResource TileLabelStyle}" />
</StackLayout>
</Frame>
<!-- ADVANCED TILE -->
<Frame Style="{DynamicResource TileStyle}">
<StackLayout HorizontalOptions="Center" VerticalOptions="Center">
<Image Style="{DynamicResource TileImageStyle}" />
<Label Style="{DynamicResource TileLabelStyle}" />
</StackLayout>
</Frame>
<!-- MY HOLIDAYS TILE -->
<Frame Style="{DynamicResource TileStyle}">
<StackLayout HorizontalOptions="Center" VerticalOptions="Center">
<Image Style="{DynamicResource TileImageStyle}" />
<Label Style="{DynamicResource TileLabelStyle}" />
</StackLayout>
</Frame>
<!-- EMPLOYEE PAY TILE -->
<Frame Style="{DynamicResource TileStyle}">
<StackLayout HorizontalOptions="Center" VerticalOptions="Center">
<Image Style="{DynamicResource TileImageStyle}" />
<Label Style="{DynamicResource TileLabelStyle}" />
</StackLayout>
</Frame>
<!-- RUNSHEET TILE -->
<Frame Style="{DynamicResource TileStyle}">
<StackLayout HorizontalOptions="Center" VerticalOptions="Center">
<Image Style="{DynamicResource TileImageStyle}" />
<Label Style="{DynamicResource TileLabelStyle}" />
</StackLayout>
</Frame>
<!-- SOS TILE -->
<Frame Style="{DynamicResource TileStyle}">
<StackLayout HorizontalOptions="Center" VerticalOptions="Center">
<Image Style="{DynamicResource TileImageStyle}" />
<Label Style="{DynamicResource TileLabelStyle}" />
</StackLayout>
</Frame>
<!-- SMARTFORMS TILE -->
<Frame Style="{DynamicResource TileStyle}">
<StackLayout HorizontalOptions="Center" VerticalOptions="Center">
<Image Style="{DynamicResource TileImageStyle}" />
<Label Style="{DynamicResource TileLabelStyle}" />
</StackLayout>
</Frame>
<!-- MY MESSAGES TILE -->
<Frame Style="{DynamicResource TileStyle}">
<StackLayout HorizontalOptions="Center" VerticalOptions="Center">
<Image Style="{DynamicResource TileImageStyle}" />
<Label Style="{DynamicResource TileLabelStyle}" />
</StackLayout>
</Frame>
<!-- EMAIL CONTROL ROOM TILE -->
<Frame Style="{DynamicResource TileStyle}">
<StackLayout HorizontalOptions="Center" VerticalOptions="Center">
<Image Style="{DynamicResource TileImageStyle}" />
<Label Style="{DynamicResource TileLabelStyle}" />
</StackLayout>
</Frame>
<!-- CALL CONTROL ROOM TILE -->
<Frame Style="{DynamicResource TileStyle}">
<StackLayout HorizontalOptions="Center" VerticalOptions="Center">
<Image Style="{DynamicResource TileImageStyle}" />
<Label Style="{DynamicResource TileLabelStyle}" />
</StackLayout>
</Frame>
<!-- LOGOFF TILE -->
<Frame Style="{DynamicResource TileStyle}">
<StackLayout HorizontalOptions="Center" VerticalOptions="Center">
<Image Style="{DynamicResource TileImageStyle}" />
<Label Style="{DynamicResource TileLabelStyle}" />
</StackLayout>
</Frame>
</FlexLayout>
</ScrollView>
</ContentPage>
Run the demo and you should see the above frames are displayed in a stacked format.
This has been tested on VS2022 17.4.4 and the Preview version is 17.5
Link to public reproduction project repository
n/a
Version with bug
7.0 (current)
Last version that worked well
7.0 (current)
Affected platforms
Android
Affected platform versions
Android 13
Did you find any workaround?
Grab the nuget from here
https://www.nuget.org/packages/PureWeen.Maui.FixesAndWorkarounds
#if ANDROID
builder.ConfigureMauiHandlers(handlers =>
{
handlers.AddHandler(typeof(Frame), typeof(WorkaroundFrameRenderer));
});
#endifor
builder.ConfigureMauiWorkarounds();Relevant log output
No response
Metadata
Metadata
Assignees
Labels
area-layoutStackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenterfixed-in-7.0.100fixed-in-7.0.101fixed-in-7.0.81Look for this fix in 7.0.81!fixed-in-8.0.0-preview.1.7762Look for this fix in 8.0.0-preview.1.7762!i/regressionThis issue described a confirmed regression on a currently supported versionlayout-flexFlexLayout issuesplatform/androidt/bugSomething isn't working
Activity
edwardwhiteheaddev commentedon Feb 7, 2023
It is important to note that I have tested this code on another machine and I get the very same result, so something has happened between the previous version where the FlexLayout was working to the new version released.
Have Frame use MinimumHeight/Width for minimums instead of constraints
jerry08 commentedon Feb 15, 2023
I just experienced this after updating. As a workaround, use
Borderinstead ofFrame. I find that theFramecontrol has many issues.edwardwhiteheaddev commentedon Feb 16, 2023
@jerry08 - thank you for this. It definitely is Frame and not FlexLayout.
4 remaining items
Have Frame use MinimumHeight/Width for minimums instead of constraints (
Have Frame use MinimumHeight/Width for minimums instead of constraints (
Have Frame use MinimumHeight/Width for minimums instead of constraints β¦
[-]FlexLayout not working after update[/-][+][regression/7.0.0] FlexLayout not working after update[/+]