Skip to content

Comments

[iOS,Windows] Fix navigation bar colors not resetting when switching ShellContent#33228

Merged
PureWeen merged 7 commits intodotnet:inflight/currentfrom
Vignesh-SF3580:fix-shellColors
Jan 8, 2026
Merged

[iOS,Windows] Fix navigation bar colors not resetting when switching ShellContent#33228
PureWeen merged 7 commits intodotnet:inflight/currentfrom
Vignesh-SF3580:fix-shellColors

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

Copy link
Contributor

@StephaneDelcroix StephaneDelcroix left a comment

Choose a reason for hiding this comment

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

✅ Approved

Code Review Summary

Issue: Navigation bar colors persist when switching between ShellContent items (#33227)

Verified

  • ✅ Code compiles successfully
  • ✅ All 286 Shell-related unit tests pass
  • ✅ ShellAppearance unit tests pass
  • ✅ Code changes are minimal and surgical

iOS Fix Analysis

The fix correctly extends ResetAppearance() to also reset the iOS 13+ UINavigationBarAppearance by calling UpdateiOS13NavigationBarAppearance(controller, null). When appearance is null, a fresh default appearance is created with ConfigureWithOpaqueBackground(), properly resetting all colors.

Windows Fix Analysis

The fix correctly clears the toolbar title foreground when brush is null using ClearValue(CommandBar.ForegroundProperty), reverting to the default/inherited value.

Test Coverage

  • HostApp test page with proper reproduction scenario
  • NUnit UI test with screenshot verification
  • Snapshots for all 4 platforms (iOS, Mac, Android, Windows)

LGTM! 🚀

@PureWeen PureWeen changed the base branch from main to inflight/current January 8, 2026 22:23
@PureWeen PureWeen merged commit b51503c into dotnet:inflight/current Jan 8, 2026
156 of 161 checks passed
PureWeen pushed a commit that referenced this pull request Jan 9, 2026
…ShellContent (#33228)

### 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
 
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

### Issues Fixed

Fixes #33227

### Screenshots

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/0665c21a-f3b9-44e1-bb95-05678560ac73">
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/29758b20-8bb4-4393-8936-5b7ccd06aab8">)
|

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/3fd239fe-1b21-4ddb-8982-ed4939b47ab9">
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/f87c760e-3d24-4a53-b96c-1bf23b818482">)
|
PureWeen pushed a commit that referenced this pull request Jan 13, 2026
…ShellContent (#33228)

### 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
 
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

### Issues Fixed

Fixes #33227

### Screenshots

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/0665c21a-f3b9-44e1-bb95-05678560ac73">
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/29758b20-8bb4-4393-8936-5b7ccd06aab8">)
|

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/3fd239fe-1b21-4ddb-8982-ed4939b47ab9">
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/f87c760e-3d24-4a53-b96c-1bf23b818482">)
|
github-actions bot pushed a commit that referenced this pull request Jan 16, 2026
…ShellContent (#33228)

### 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
 
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

### Issues Fixed

Fixes #33227

### Screenshots

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/0665c21a-f3b9-44e1-bb95-05678560ac73">
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/29758b20-8bb4-4393-8936-5b7ccd06aab8">)
|

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/3fd239fe-1b21-4ddb-8982-ed4939b47ab9">
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/f87c760e-3d24-4a53-b96c-1bf23b818482">)
|
github-actions bot pushed a commit that referenced this pull request Jan 20, 2026
…ShellContent (#33228)

### 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
 
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

### Issues Fixed

Fixes #33227

### Screenshots

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/0665c21a-f3b9-44e1-bb95-05678560ac73">
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/29758b20-8bb4-4393-8936-5b7ccd06aab8">)
|

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/3fd239fe-1b21-4ddb-8982-ed4939b47ab9">
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/f87c760e-3d24-4a53-b96c-1bf23b818482">)
|
github-actions bot pushed a commit that referenced this pull request Jan 21, 2026
…ShellContent (#33228)

### 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
 
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

### Issues Fixed

Fixes #33227

### Screenshots

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/0665c21a-f3b9-44e1-bb95-05678560ac73">
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/29758b20-8bb4-4393-8936-5b7ccd06aab8">)
|

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/3fd239fe-1b21-4ddb-8982-ed4939b47ab9">
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/f87c760e-3d24-4a53-b96c-1bf23b818482">)
|
github-actions bot pushed a commit that referenced this pull request Jan 23, 2026
…ShellContent (#33228)

### 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
 
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

### Issues Fixed

Fixes #33227

### Screenshots

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/0665c21a-f3b9-44e1-bb95-05678560ac73">
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/29758b20-8bb4-4393-8936-5b7ccd06aab8">)
|

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/3fd239fe-1b21-4ddb-8982-ed4939b47ab9">
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/f87c760e-3d24-4a53-b96c-1bf23b818482">)
|
PureWeen pushed a commit that referenced this pull request Jan 23, 2026
…ShellContent (#33228)

### 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
 
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

### Issues Fixed

Fixes #33227

### Screenshots

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/0665c21a-f3b9-44e1-bb95-05678560ac73">
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/29758b20-8bb4-4393-8936-5b7ccd06aab8">)
|

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/3fd239fe-1b21-4ddb-8982-ed4939b47ab9">
| <video width="300" height="600"
src="https://github.com/user-attachments/assets/f87c760e-3d24-4a53-b96c-1bf23b818482">)
|
PureWeen added a commit that referenced this pull request Jan 25, 2026
## What's Coming

.NET MAUI inflight/candidate introduces significant improvements across
all platforms with focus on quality, performance, and developer
experience. This release includes 16 commits with various improvements,
bug fixes, and enhancements.


## Checkbox
- [Android] Implement material3 support for CheckBox by
@HarishwaranVijayakumar in #33339
  <details>
  <summary>🔧 Fixes</summary>

- [Implement Material3 Support for
CheckBox](#33338)
  </details>

## CollectionView
- [Android] Fixed EmptyView doesn’t display when CollectionView is
placed inside a VerticalStackLayout by @NanthiniMahalingam in
#33134
  <details>
  <summary>🔧 Fixes</summary>

- [CollectionView does not show an EmptyView template with an empty
collection](#32932)
  </details>

## Essentials
- [Windows]Fix NullReferenceException in OpenReadAsync for FileResult
created with full path by @devanathan-vaithiyanathan in
#28238
  <details>
  <summary>🔧 Fixes</summary>

- [[Windows] FileResult(string fullPath) not initialized
properly](#26858)
  </details>

## Image
- Fix Glide IllegalArgumentException in MauiCustomTarget.clear() for
destroyed activities by @jfversluis via @Copilot in
#29780
  <details>
  <summary>🔧 Fixes</summary>

- [java.lang.IllegalArgumentException: You cannot start a load for a
destroyed activity - glide](#29699)
  </details>

## Label
- [Android] Fix for Label WordWrap width issue causing HorizontalOptions
misalignment by @praveenkumarkarunanithi in
#33281
  <details>
  <summary>🔧 Fixes</summary>

- [[Android] Unexpected Line Breaks in Android, Label with WordWrap Mode
Due to Trailing Space.](#31782)
- [Label not sized correctly on
Android](#27614)
  </details>

- Fix to Improve Flyout Accessibility by Adjusting UITableViewController
Labels by @SuthiYuvaraj in #31619
  <details>
  <summary>🔧 Fixes</summary>

- [Navigation section present under hamburger are programmatically
define as table :A11y_.NET maui_User can get all the insights of
Dashboard_Devtools](#30894)
  </details>

## Mediapicker
- [Regression][iOS] Fix MediaPicker PickPhotosAsync getting file name in
contentType property by @devanathan-vaithiyanathan in
#33390
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] MediaPicker PickPhotosAsync getting file name in contentType
property](#33348)
  </details>

## Navigation
- Fix handler not disconnected when removing non visible pages using
RemovePage() by @Vignesh-SF3580 in
#32289
  <details>
  <summary>🔧 Fixes</summary>

- [NavigationPage.Navigation.RemovePage() fails to disconnect handlers
when removing pages, unlike
ContentPage.Navigation.RemovePage()](#32239)
  </details>

## Picker
- [Android] Fix Picker IsOpen not reset when picker is dismissed by
@devanathan-vaithiyanathan in #33332
  <details>
  <summary>🔧 Fixes</summary>

- [[Android] Picker IsOpen not reset when picker is
dismissed](#33331)
  </details>

## Shell
- [iOS & Catalyst ] Fixed IsEnabled property should work on Tabs by
@SubhikshaSf4851 in #33369
  <details>
  <summary>🔧 Fixes</summary>

- [[Catalyst] TabBarBackgroundColor, TabBarUnselectedColor, and
IsEnabled Not Working as Expected in
Shell](#33158)
  </details>

- [iOS,Windows] Fix navigation bar colors not resetting when switching
ShellContent by @Vignesh-SF3580 in
#33228
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS, Windows] Shell Navigation bar colors are not updated correctly
when switching
ShellContent](#33227)
  </details>

- [iOS] Fixed Shell navigation on search handler suggestion selection by
@SubhikshaSf4851 in #33406
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] Clicking on search suggestions fails to navigate to detail page
correctly](#33356)
  </details>

## Templates
- Fix VoiceOver doesnot announces the State of the ComboBox by
@SuthiYuvaraj in #32286

## Xaml
- [XSG][BindingSourceGen] Add support for CommunityToolkit.Mvvm
ObservablePropertyAttribute by @simonrozsival via @Copilot in
#33028
  <details>
  <summary>🔧 Fixes</summary>

- [[XSG] Add heuristic to support bindable properties generated by other
source generators](#32597)
  </details>


<details>
<summary>📦 Other (2)</summary>

- [XSG] Improve diagnostic reporting during binding compilation by
@simonrozsival via @Copilot in #32905
- [Testing] Fixed Test case failure in PR 33574 - [01/19/2026] Candidate
- 1 by @TamilarasanSF4853 in #33602

</details>
**Full Changelog**:
main...inflight/candidate
@github-actions github-actions bot locked and limited conversation to collaborators Feb 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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

4 participants