Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -455,11 +455,19 @@ void UpdateLargeTitles()
if (page is null || !OperatingSystem.IsIOSVersionAtLeast(11))
return;

// Shell doesn't have the property PrefersLargeTitles, so we should not update the large titles
// if users doen't explicitly set the LargeTitleDisplay property on the Page.
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

Spelling error in comment: "doen't" should be "doesn't".

Suggested change
// if users doen't explicitly set the LargeTitleDisplay property on the Page.
// if users doesn't explicitly set the LargeTitleDisplay property on the Page.

Copilot uses AI. Check for mistakes.
// todo net 11: Add PrefersLargeTitles to Shell and use that here.
if (!page.IsSet(PlatformConfiguration.iOSSpecific.Page.LargeTitleDisplayProperty))
{
return;
}

var largeTitleDisplayMode = page.OnThisPlatform().LargeTitleDisplay();

if (SelectedViewController is UINavigationController navigationController)
{
navigationController.NavigationBar.PrefersLargeTitles = largeTitleDisplayMode == LargeTitleDisplayMode.Always;
navigationController.NavigationBar.PrefersLargeTitles = largeTitleDisplayMode != LargeTitleDisplayMode.Never;
var top = navigationController.TopViewController;
if (top is not null)
{
Expand Down
51 changes: 51 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue33037.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 33037, "iOS Large Title display disappears when scrolling in Shell", PlatformAffected.iOS)]
public class Issue33037 : TestShell
{
protected override void Init()
{
var page = new ContentPage
{
Title = "Large Title Test"
};

// Explicitly set LargeTitleDisplay to Always — this should show a large title
Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page.SetLargeTitleDisplay(
page,
Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.LargeTitleDisplayMode.Always);

var scrollView = new ScrollView
{
AutomationId = "TestScrollView",
Content = new VerticalStackLayout
{
Children =
{
new Label
{
Text = "Large Title Test Page",
AutomationId = "PageTitle",
FontSize = 18,
Margin = new Thickness(20, 10)
}
}
}
};

// Add enough items to make the page scrollable
var layout = (VerticalStackLayout)scrollView.Content;
for (int i = 0; i < 30; i++)
{
layout.Children.Add(new Label
{
Text = $"Item {i}",
AutomationId = $"Item{i}",
Margin = new Thickness(20, 5)
});
}

page.Content = scrollView;
AddContentPage(page);
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_WINDOWS
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue33037 : _IssuesUITest
{
public Issue33037(TestDevice testDevice) : base(testDevice)
{
}

public override string Issue => "iOS Large Title display disappears when scrolling in Shell";

[Test]
[Category(UITestCategories.Shell)]
public void LargeTitleTransitionsOnScroll()
{
// Verify page loaded with large title visible
App.WaitForElement("PageTitle");

// Take a screenshot before scrolling to verify large title is shown
VerifyScreenshot("Issue33037_BeforeScroll");

// Scroll down to trigger the large title → standard title transition
App.ScrollDown("TestScrollView");
App.ScrollDown("TestScrollView");

// Take screenshot after scrolling — title should have transitioned to standard size
VerifyScreenshot("Issue33037_AfterScroll", retryTimeout: TimeSpan.FromSeconds(2));
}
}
#endif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading