-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[iOS] Fix added for Navigation.SetTitleView does not work in ios 26. #31831
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
Conversation
There was a problem hiding this 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
|
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. |
|
/backport to release/10.0.1xx-rc2 |
|
Started backporting to release/10.0.1xx-rc2: https://github.com/dotnet/maui/actions/runs/18141880750 |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
|
Failures are not related the fix. |
|
in which version this will be included ? |
|
@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. |
* [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]>
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
TitleViewcontainer 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:
Containerclass constructor, for iOS 26+ and Mac Catalyst 26+, the container now uses autoresizing masks (TranslatesAutoresizingMaskIntoConstraints = trueand setsAutoresizingMask) instead of constraints to ensure proper TitleView display. For iOS 11+ and Mac Catalyst 11+, constraints are still used.Frameproperty 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