Skip to content

[iOS] SafeArea is not applied when a ContentPage uses a ControlTemplate #33458

@MatthewJer

Description

@MatthewJer

Description

When a ContentPage uses a ControlTemplate, the ContentPresenter no longer appears to respect the SafeArea.
Wrapping the ContentPresenter in a Border inside the ControlTemplate causes the Border to extend into the SafeArea, while the ContentPresenter itself still ignores it.
This behavior worked correctly in .NET 8 and .NET 9.
The now-deprecated IgnoreSafeArea property also has no effect.
Any suggestions for a temporary workaround would be greatly appreciated.

Steps to Reproduce

  1. Clone the provided reproduction repository.
  2. Open the solution.
  3. Run the application on an iOS device or simulator.

Expected Behavior

  • The ContentPresenter should respect the SafeArea.
  • Any content wrapped around the ContentPresenter (e.g. a Border) should be laid out inside the SafeArea.
  • This matches the behavior observed in .NET 8 and .NET 9.

Actual Behavior

  • As soon as the ContentPage uses a ControlTemplate, the ContentPresenter no longer respects the SafeArea.
  • If a Border is placed around the ContentPresenter inside the ControlTemplate, the Border extends into the SafeArea.
  • The ContentPresenter itself still ignores the SafeArea.
  • The deprecated IgnoreSafeArea property has no effect.

Link to public reproduction project repository

https://github.com/MatthewJer/TestSafeAreaEdges

Version with bug

10.0.20

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

9.0.120 SR12

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-safeareaIssues/PRs that have to do with the SafeArea functionalityi/regressionThis issue described a confirmed regression on a currently supported versionplatform/ioss/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions