Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] SafeArea arrange insets are currently insetting based on an incorrect Bounds #24246

Open
PureWeen opened this issue Aug 14, 2024 · 1 comment · Fixed by #23729 · May be fixed by #27043
Open

[iOS] SafeArea arrange insets are currently insetting based on an incorrect Bounds #24246

PureWeen opened this issue Aug 14, 2024 · 1 comment · Fixed by #23729 · May be fixed by #27043
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter fixed-in-8.0.90 fixed-in-9.0.0-rc.2.24503.2 s/triaged Issue has been reviewed t/bug Something isn't working
Milestone

Comments

@PureWeen
Copy link
Member

Description

The problem we found is that the MauiView returns a size from SizeThatFits that doesn't include the SafeAreaInsets. The arrange pass insets its Bounds and passes this value to CrossPlatformArrange but the Bounds being used is the size of the children not including the SafeAreaInsets which means the bounds used for arranging is wrong.

You can see from the screenshots below that the VSL surrounding the the entry gets arranged incorrectly

Comparison

Given the following XAML

<ContentPage
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    x:Class="Maui.Controls.Sample.MainPage"
    xmlns:local="clr-namespace:Maui.Controls.Sample"
    xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls"
    ios:Page.UseSafeArea="false"
    >
    <VerticalStackLayout x:Name="layout" Background="Purple" IgnoreSafeArea="False" VerticalOptions="Start" IsClippedToBounds="True" >
        <Entry x:Name="label" Background="Green" Text="Hello there"></Entry>
    </VerticalStackLayout>
</ContentPage>

Before

image

@dotnet-policy-service dotnet-policy-service bot added the s/triaged Issue has been reviewed label Aug 14, 2024
@PureWeen PureWeen added this to the .NET 8 SR9 milestone Aug 14, 2024
Copy link
Contributor

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@PureWeen PureWeen moved this from Todo to Ready To Review in MAUI SDK Ongoing Aug 17, 2024
@samhouts samhouts added t/bug Something isn't working area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter labels Aug 23, 2024
@github-project-automation github-project-automation bot moved this from Ready To Review to Done in MAUI SDK Ongoing Sep 3, 2024
@PureWeen PureWeen reopened this Sep 4, 2024
@PureWeen PureWeen modified the milestones: .NET 8 SR9, .NET 10 SR1 Sep 4, 2024
@PureWeen PureWeen modified the milestones: .NET 9 SR1, .NET 9 SR2 Oct 30, 2024
@PureWeen PureWeen modified the milestones: .NET 9 SR2, .NET 9 SR3 Nov 27, 2024
@PureWeen PureWeen modified the milestones: .NET 9 SR3, .NET 9 SR4 Jan 5, 2025
@PureWeen PureWeen linked a pull request Jan 9, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter fixed-in-8.0.90 fixed-in-9.0.0-rc.2.24503.2 s/triaged Issue has been reviewed t/bug Something isn't working
Projects
Status: In Progress
2 participants