Skip to content

Commit 8518b30

Browse files
committed
Add UpdateTitleViewInternal for iOS 26+ compatibility
Introduces UpdateTitleViewInternal in ShellPageRendererTracker and calls it from ShellSectionRenderer for iOS 26+ and Mac Catalyst 26+. This ensures TitleView is updated correctly when the ViewController is added to a NavigationController, addressing layout issues on newer OS versions.
1 parent a1638bf commit 8518b30

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellPageRendererTracker.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@ protected virtual void OnRendererSet()
271271
ViewController.AutomaticallyAdjustsScrollViewInsets = false;
272272
}
273273
}
274+
275+
internal void UpdateTitleViewInternal()
276+
{
277+
UpdateTitleView();
278+
}
274279

275280
protected virtual void UpdateTitleView()
276281
{

src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,13 @@ public override void WillShowViewController(UINavigationController navigationCon
824824
tracker is ShellPageRendererTracker shellRendererTracker)
825825
{
826826
shellRendererTracker.UpdateToolbarItemsInternal(false);
827+
if (OperatingSystem.IsIOSVersionAtLeast(26) || OperatingSystem.IsMacCatalystVersionAtLeast(26))
828+
{
829+
// If we are on iOS 26+ and the ViewController is not in a NavigationController yet,
830+
// we cannot set the TitleView yet as it would not layout correctly.
831+
// So we update it later when the ViewController is added to the NavigationController
832+
shellRendererTracker.UpdateTitleViewInternal();
833+
}
827834
}
828835
}
829836

0 commit comments

Comments
 (0)