Skip to content

Conversation

@sheiksyedm
Copy link
Contributor

@sheiksyedm sheiksyedm commented Sep 30, 2025

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description of Change

This pull request updates the handling of layout logic for the navigation bar's TitleView container in the iOS compatibility renderer. The changes ensure correct display and sizing behavior on iOS 26+ by switching to autoresizing masks, while maintaining compatibility with older iOS versions.

Platform-specific layout adjustments:

  • In the Container class constructor, for iOS 26+ and Mac Catalyst 26+, the container now uses autoresizing masks (TranslatesAutoresizingMaskIntoConstraints = true and sets AutoresizingMask) instead of constraints to ensure proper TitleView display. For iOS 11+ and Mac Catalyst 11+, constraints are still used.
  • In the Frame property override, the logic is updated so that for iOS 26+, Mac Catalyst 26+, and pre-iOS 11, autoresizing masks are used and the frame is manually adjusted. This maintains correct sizing and positioning across different platform versions.

Fixes #31671
Fixes #31815

Copilot AI review requested due to automatic review settings September 30, 2025 17:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes layout issues with navigation bar TitleView containers on iOS 26+ by updating the compatibility renderer to use autoresizing masks instead of constraints. The changes maintain backward compatibility while addressing display problems that occur with the newer iOS version.

  • Adds iOS 26+ version checks to switch from constraints to autoresizing masks for proper TitleView display
  • Updates frame adjustment logic to handle both iOS 26+ and pre-iOS 11 scenarios with autoresizing
  • Maintains existing behavior for iOS 11-25 versions that continue using constraints

@sheiksyedm sheiksyedm changed the title Fix 31671 [iOS] Fix added for Navigation.SetTitleView does not work in ios 26. Sep 30, 2025
@sheiksyedm sheiksyedm added area-navigation NavigationPage platform/ios area-controls-titleview TitleView partner/syncfusion Issues / PR's with Syncfusion collaboration version/iOS-26 labels Sep 30, 2025
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Sep 30, 2025
@dotnet-policy-service
Copy link
Contributor

Hey there @@sheiksyedm! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@PureWeen PureWeen added this to the .NET 9 SR12 milestone Sep 30, 2025
@PureWeen
Copy link
Member

/backport to release/10.0.1xx-rc2

@github-actions
Copy link
Contributor

Started backporting to release/10.0.1xx-rc2: https://github.com/dotnet/maui/actions/runs/18141880750

@rmarinho
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this affect Shell TitleView as well, or only NavigationPage TitleView?

public Container(View view, UINavigationBar bar) : base(bar.Bounds)
{
if (OperatingSystem.IsIOSVersionAtLeast(11) || OperatingSystem.IsMacCatalystVersionAtLeast(11))
// For iOS 26+, we need to use autoresizing masks instead of constraints to ensure proper TitleView display
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we include some tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsuarezruiz We already have many test cases covering the TitleView, so adding a new one would be repetitive. This fix simply ensures that the TitleView is displayed on iOS 26, and the existing tests already validate TitleView behavior. For this reason, I have not added new tests. Also, the failures would occur only when building with iOS 26.

@sheiksyedm
Copy link
Contributor Author

Failures are not related the fix.

@rmarinho rmarinho merged commit d6bbe9d into dotnet:main Oct 1, 2025
124 of 131 checks passed
@kdbhalala
Copy link

in which version this will be included ?

@seth-govalidate
Copy link

@kdbhalala I'm going to make the assumption it is in https://www.nuget.org/packages/Microsoft.Maui.Controls/9.0.120 that was released yesterday since it is listed fixed under https://github.com/dotnet/maui/releases/tag/9.0.120.

rmarinho added a commit that referenced this pull request Oct 18, 2025
* [Testing] Fix for flaky UITests CookiesCorrectlyLoadWithMultipleWebViews in CI (#31823)

This PR addresses the UI test image failures that occurred in the main
branch and includes updates to improve rendering and test stability
across platforms.

- In the CookiesCorrectlyLoadWithMultipleWebViews test case, I changed
the WebView source to match the cookies.

### Test cases:

- CookiesCorrectlyLoadWithMultipleWebViews

* [iOS] Fix added for Navigation.SetTitleView does not work in ios 26. (#31831)

* [iOS] Fix added for Navigation.SetTitleView does not work in ios 26.

* changes added.

* changed the version condition.

* [testing] Update androidApiLevels for device tests (#31827)

* Update androidApiLevels for device tests

* [ci] Update provisioning of api 36

* Add reference (#31669)

* [Windows, Catalyst] Fix IsPresented=true Not Working on Initial Value in FlyoutPage (#31515)

* mac fix added

* Windows fix added

* test case added

* Update Issue31372.cs

* Update Issue31372.cs

* Update WindowHandler.iOS.cs

* fix updated

* Update WindowHandler.iOS.cs

* Update WindowHandler.iOS.cs

* Update PublicAPI.Shipped.txt

* changes added in UnShipped file

* Temporarily disable flaky WebView tests using FlakyTest attribute (#31868)

* Initial plan

* Temporarily disable flaky WebView tests with FlakyTest attribute

Co-authored-by: rmarinho <[email protected]>

* Add tracking issue link to FlakyTest attributes

Co-authored-by: rmarinho <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: rmarinho <[email protected]>

* Invert NavigationPage UseMauiHandler flag (#31859)

* Update dependencies from https://github.com/dotnet/xharness build 20251004.2 (#31872)

On relative base path root
Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit From Version 9.0.0-prerelease.25426.1 -> To Version 9.0.0-prerelease.25504.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* [release/9.0.1xx-sr12] Fix ProjectList not displaying due to missing BindingContext update in template sample (#31954)

* update ProjectListPage

* Update MauiApp.1.csproj

---------

Co-authored-by: Vignesh-SF3580 <[email protected]>

* [release/9.0.1xx-sr12] [Android] -Picker dialog causes crash when page is popped while dialo… (#31919)

* [Android] -Picker dialog causes crash when page is popped while dialog is open

* removed the dispose call.

* Revert "removed the dispose call."

This reverts commit e1e7a9f.

* removed the dispose call.

* Modified with Dismiss() method.

---------

Co-authored-by: sheiksyedm <[email protected]>

* [release/9.0.1xx-sr12] [iOS] Fix memory leak in CollectionViewHandler2 ItemsLayout PropertyChanged subscription (#31922)

* [release/9.0.1xx-sr12] [Android][Regression] Fixed Entry and Editor AppThemeBinding colors for text and placeholder reset to default on theme change (#31921)

* added snapshots and fix

* removed test cases

* added the test cases and snapshots

* added braces

* added mac and windows snapshots

* added mac and windows snapshots

* added snapshot

---------

Co-authored-by: TamilarasanSF4853 <[email protected]>

* 9.0.120 Release Branding (#31979)

* [release/9.0.1xx-sr12] [ci] Update arcade main (#31987)

* Update arcade

* Don t use internal feeds

---------

Co-authored-by: Rui Marinho <[email protected]>

* Update FlyoutViewHandler.Windows.cs (#32007)

Co-authored-by: devanathan-vaithiyanathan <[email protected]>

---------

Co-authored-by: TamilarasanSF4853 <[email protected]>
Co-authored-by: sheiksyedm <[email protected]>
Co-authored-by: Rui Marinho <[email protected]>
Co-authored-by: MartyIX <[email protected]>
Co-authored-by: devanathan-vaithiyanathan <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: rmarinho <[email protected]>
Co-authored-by: Tim Miller <[email protected]>
Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Vignesh-SF3580 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-titleview TitleView area-navigation NavigationPage community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/ios version/iOS-26

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NavigationPage.TitleView content is not displayed on iPadOS 26 when built with Xcode 26 Navigation.SetTitleView does not work in ios 26

6 participants