Skip to content

Commit c5dcff3

Browse files
[release/10.0.1xx-rc2] [iOS] Fix added for Navigation.SetTitleView does not work in ios 26. (#31832)
* [iOS] Fix added for Navigation.SetTitleView does not work in ios 26. * changes added. * changed the version condition. --------- Co-authored-by: sheiksyedm <[email protected]>
1 parent 0deee32 commit c5dcff3

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Controls/src/Core/Compatibility/Handlers/NavigationPage/iOS/NavigationRenderer.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2089,7 +2089,13 @@ class Container : UIView
20892089

20902090
public Container(View view, UINavigationBar bar) : base(bar.Bounds)
20912091
{
2092-
if (OperatingSystem.IsIOSVersionAtLeast(11) || OperatingSystem.IsMacCatalystVersionAtLeast(11))
2092+
// For iOS 26+, we need to use autoresizing masks instead of constraints to ensure proper TitleView display
2093+
if (OperatingSystem.IsIOSVersionAtLeast(26) || OperatingSystem.IsMacCatalystVersionAtLeast(26))
2094+
{
2095+
TranslatesAutoresizingMaskIntoConstraints = true;
2096+
AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
2097+
}
2098+
else if (OperatingSystem.IsIOSVersionAtLeast(11) || OperatingSystem.IsMacCatalystVersionAtLeast(11))
20932099
{
20942100
TranslatesAutoresizingMaskIntoConstraints = false;
20952101
}
@@ -2178,7 +2184,9 @@ public override CGRect Frame
21782184
{
21792185
if (Superview != null)
21802186
{
2181-
if (!(OperatingSystem.IsIOSVersionAtLeast(11) || OperatingSystem.IsMacCatalystVersionAtLeast(11)))
2187+
// For iOS 26+ and pre-iOS 11, we use autoresizing masks and need to adjust the frame manually
2188+
if (OperatingSystem.IsIOSVersionAtLeast(26) || OperatingSystem.IsMacCatalystVersionAtLeast(26) ||
2189+
!(OperatingSystem.IsIOSVersionAtLeast(11) || OperatingSystem.IsMacCatalystVersionAtLeast(11)))
21822190
{
21832191
value.Y = Superview.Bounds.Y;
21842192

0 commit comments

Comments
 (0)