maui
maui copied to clipboard
Too much spacing between two rows with a FlexLayout on Android.
Description
I have a FlexLayout that with three items looks that like this on Android and Windows:
With four items a new row is added. But on Android the spacing between the rows are too large, but it if fine on Windows.
Steps to Reproduce
- Create a new MAUI app.
- Replace the content in MainPage.xaml with this:
<ScrollView>
<FlexLayout
Direction="Row"
BackgroundColor="LightPink"
AlignItems="Start"
JustifyContent="Start"
Wrap="Wrap"
VerticalOptions="Start"
>
<Grid HeightRequest="100"
WidthRequest="100"
BackgroundColor="AliceBlue"
Margin="4">
<Label Text="One"
TextColor="DarkBlue"
HorizontalOptions="Center"
VerticalOptions="Center"
/>
</Grid>
<Grid HeightRequest="100"
WidthRequest="100"
BackgroundColor="AliceBlue"
Margin="4">
<Label Text="Two"
TextColor="DarkBlue"
HorizontalOptions="Center"
VerticalOptions="Center"
/>
</Grid>
<Grid HeightRequest="100"
WidthRequest="100"
BackgroundColor="AliceBlue"
Margin="4">
<Label Text="Three"
TextColor="DarkBlue"
HorizontalOptions="Center"
VerticalOptions="Center"
/>
</Grid>
<Grid HeightRequest="100"
WidthRequest="100"
BackgroundColor="AliceBlue"
Margin="4">
<Label Text="Four"
TextColor="DarkBlue"
HorizontalOptions="Center"
VerticalOptions="Center"
/>
</Grid>
</FlexLayout>
</ScrollView>
- Run the application on Android and Windows.
Link to public reproduction project repository
https://github.com/pekspro/MauiIssues/tree/10698_Too_much_spacing_between_two_rows_with_a_FlexLayout
Version with bug
6.0.486 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android, Windows, I was not able test on other platforms
Affected platform versions
Android 11
Did you find any workaround?
No response
Relevant log output
No response
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.
I've updated sample application to .NET 7. The same issue remains.
I'm having the same problem in .NET 7.
Verified this issue with Visual Studio 17.7.0 Preview 1.0. Can repro on android platform with sample project.
MauiIssues-10698_Too_much_spacing_between_two_rows_with_a_FlexLayout.zip
try use AlignContent="Start"