Grid default child layout changed
See original GitHub issueDescription
Moving from .NET Maui 7.0.0-rc.1 to 7.0.0-rc.2 seems to have introduced a significant change in Grid behavior. In previous builds (including Maui 6.0), children of Grid seemed to default to LayoutOption.Fill behaviors, but in rc2, child elements that do not have an explicit HorizontalOptions or VerticalOptions seem to be appearing in the upper-left corner of a cell.
The problem may be even worse, because if I try to add explicit Fill values for HorizontalOptions and VerticalOptions (a potential workaround), the problem does not seem to go away!
Steps to Reproduce
- Create a new .NET Maui app.
- In the default ContentPage, page the content below.
- When executed in 7.0.0-rc.1 or earlier, you will see that the “pink label” will fill the entire 36x36 rectangle and you won’t see any of the “aqua” background. When viewed in 7.0.0-rc.2, the label appears in the upper-left corner.
- EVEN WORSE… if you add HorizontalOptions=“Center” and VerticalOptions=“Center”, the label does not move!
Content:
<Grid BackgroundColor="Aqua" HeightRequest="36" WidthRequest="36">
<Label FontSize="20" BackgroundColor="Pink" VerticalTextAlignment="Center"
HorizontalTextAlignment="Center" >A</Label>
</Grid>
Link to public reproduction project repository
(Not public)
Version with bug
7.0 Release Candidate 2
Last version that worked well
7.0 Release Candidate 1
Affected platforms
iOS, Windows
Affected platform versions
Windows SDK 10.0.17763.0, iOS 16
Did you find any workaround?
No. Even if the defaults had changed, I would have expected that explicitly setting HorizontalOptions and VeritcalOptions would have worked… but it did not! I’m not aware of a workaround.
Relevant log output
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (1 by maintainers)
This will be fixed by #10768
@PureWeen: this is still repro-ing in .NET 7.0.100-rc.2.22477.23 (Visual Studio Version 17.4.0 Preview 6.0). Is that expected?