Skip to content

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

Open
@PureWeen

Description

@PureWeen

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

Metadata

Metadata

Assignees

Labels

area-layoutStackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenters/triagedIssue has been reviewedt/bugSomething isn't working

Type

No type

Projects

Status

In Progress

Relationships

None yet

Development

No branches or pull requests

Issue actions