Skip to content

Conversation

@Vignesh-SF3580
Copy link
Contributor

Issue details

When switching between ShellContent items, navigation bar colors from the previously displayed page are incorrectly applied to the next page, even when the next page does not define any navigation bar colors.
On iOS, background and title colors persist across pages.
On Windows, the issue is limited to TitleColor, which remains applied when navigating to an uncolored page.

Root cause

iOS:
Navigation bar appearance is applied via SetAppearance in ShellNavBarAppearanceTracker when colors are specified. However, when navigating to a page without defined colors, the appearance is not reset, causing previously applied colors to persist.

Windows:
The toolbar title foreground is updated only when a brush is provided. When switching to a page without a TitleColor, the previous brush is not cleared, so the title color remains.

Description of change

iOS:
Reset the navigation bar appearance to the default native appearance when no colors are specified, ensuring that colors from a previous page are not carried over.

Windows:
Clear the toolbar title foreground when the brush is null, allowing the title color to revert to the system default instead of retaining the previous color.

Tested the behavior in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Issues Fixed

Fixes #33227

Screenshots

Before Issue Fix After Issue Fix
33227BeforeFix.mov
33227AfterFix.mov
Before Issue Fix After Issue Fix
TitleBefore.mp4
TitleAfter.mp4

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 19, 2025
@Vignesh-SF3580 Vignesh-SF3580 added the community ✨ Community Contribution label Dec 19, 2025
@sheiksyedm sheiksyedm marked this pull request as ready for review December 19, 2025 07:41
Copilot AI review requested due to automatic review settings December 19, 2025 07:41
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 a bug where navigation bar colors incorrectly persist when switching between ShellContent items on iOS and Windows. When navigating from a page with custom navigation bar colors to a page without defined colors, the previous colors were not being cleared.

Key changes:

  • iOS: Reset navigation bar appearance to default when no colors are specified
  • Windows: Clear toolbar title foreground when brush is null to prevent color persistence
  • Added comprehensive UI tests to verify the fix on both platforms

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.

File Description
src/Core/src/Platform/Windows/MauiToolbar.xaml.cs Clears the title foreground property when brush is null to prevent color persistence
src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellNavBarAppearanceTracker.cs Resets navigation bar appearance to default when appearance is null, preventing color carryover
src/Controls/tests/TestCases.HostApp/Issues/Issue33227.cs Adds test application with two pages demonstrating the issue
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue33227.cs Adds UI test to verify navigation bar colors reset correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-shell Shell Navigation, Routes, Tabs, Flyout community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/ios platform/windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS, Windows] Shell Navigation bar colors are not updated correctly when switching ShellContent

2 participants