Skip to content

[.NET 11] [iOS/Android] Shell: Render gradient backgrounds on bottom tab bars - #37137

Merged
kubaflo merged 23 commits into
dotnet:net11.0from
Dhivya-SF4094:fix-shellGradientColor
Oct 24, 2026
Merged

kubaflo merged 23 commits into
dotnet:net11.0from
Dhivya-SF4094:fix-shellGradientColor

Conversation

@Dhivya-SF4094

@Dhivya-SF4094 Dhivya-SF4094 commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Root Cause

Shell.Background supports brush types such as SolidColorBrush, LinearGradientBrush, and RadialGradientBrush. However, the Shell bottom tab-bar appearance trackers consumed only EffectiveTabBarBackgroundColor, which can represent only a single Color.

Consequently, gradients assigned through Shell.Background were not propagated to the native bottom tab bar:

  • iOS: The shared internal iOS 15+ tab-bar appearance helper accepted only a Color, so gradient information could not reach the native background layer.
  • Android: The bottom navigation tracker always selected a solid color and rendered it using a MaterialShapeDrawable or ColorChangeRevealDrawable.

Description of Change

Added brush-aware Shell tab-bar background resolution with the following precedence:

  1. Shell.TabBarBackgroundColor
  2. A supported solid or gradient Shell.Background
  3. Shell.BackgroundColor
  4. Platform default

The existing color-only EffectiveTabBarBackgroundColor behavior remains available for platforms that do not consume the brush-aware path.

Unsupported tab-bar brushes, such as ImageBrush, fall back to the configured Shell.BackgroundColor or the platform default rather than suppressing that color fallback.

Shared Shell appearance

  • Added the internal ShellAppearance.EffectiveTabBarBackground resolution path so Android and iOS consume the same precedence.
  • Used the existing weak brush proxy for Shell appearance observers so in-place SolidColorBrush.Color and GradientStop changes reapply the native appearance without a shared brush retaining disconnected Shells.
  • Kept observing assigned gradients while their stop collections are empty, allowing clear/repopulate transitions to update the appearance.
  • Detached weak brush subscriptions when the assigned brush changes or the appearance observer is removed. A tab-bar color override preserves navigation-bar brush invalidation while retaining precedence for the tab bar itself.

iOS and Mac Catalyst

  • Updated the shared internal UpdateiOS15TabBarAppearance helper to accept a Paint? instead of a Color?.
  • Propagated Shell brushes through the existing implicit Brush-to-Paint conversion, supporting SolidPaint, LinearGradientPaint, and RadialGradientPaint.
  • Rendered gradients through the native tab-bar background layer.
  • Disabled the native blur/background effect while a gradient is active so the gradient retains its intended appearance.
  • Removed previously created background layers when updating or resetting the Shell tab-bar appearance.
  • Updated both TabbedPage implementations to preserve BarBackground before falling back to null-safe BarBackgroundColor?.AsPaint().
  • Routed iOS 15+ brush assignments, gradient invalidations, and appearance refreshes through one Paint-based background-layer implementation, avoiding stale or duplicate legacy layers.
  • Restored the default background effect when moving from a gradient to a solid/default appearance, and added the corresponding Mac Catalyst dispatch checks and internal platform annotations.
  • Kept direct native tab-bar view fill limited to brush-origin backgrounds, preserving the existing appearance of color-only properties. Restored captured navigation-bar appearances and translucency when clearing a Shell brush.

Android

  • Kept brush dispatch in a private, nonvirtual SetBackground(BottomNavigationView, Brush) helper rather than introducing a new protected API.
  • Routed gradient brushes through the existing platform Paint rendering path, with cleanup for both current MauiDrawable and legacy GradientStrokeDrawable backgrounds.
  • Kept solid-color and legacy/default-color reset dispatch through the existing protected virtual SetBackgroundColor(BottomNavigationView, Color) method.
  • Preserved the target branch's Material 3 native appearance capture/restoration for unset backgrounds.
  • Kept the solid-color implementation in that existing method, removing the unnecessary private forwarding helper.
  • Preserved the existing color-transition animation for solid-to-solid changes.
  • Applied a solid MaterialShapeDrawable directly when transitioning from a gradient, avoiding a reveal-from-transparent flash and disposing the replaced gradient drawable.
  • Preserved an unchanged material fill on subsequent appearance updates instead of starting a new transparent-to-color reveal.
  • Kept mutable solid toolbar backgrounds synchronized through a weak brush subscription, including handler notification on in-place color changes.

Public API compatibility: No new public or protected API, no signature changes to shipped APIs, and no deprecations. All PublicAPI.Shipped.txt and PublicAPI.Unshipped.txt files match the PR's target merge base.

Issues Fixed

Fixes #37138

Validated the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

The checkboxes above preserve the original PR validation. The initial API-neutral change was independently validated on Android. The subsequent review fixes were tested on Android API 30 and an iPhone 11 Pro simulator running iOS 26.5; Mac Catalyst received compilation/API validation only, and Windows runtime validation was not rerun.

Screenshots

Before After
iOS
Android

API-neutral rework validation

Validated commit 8d12aac016db3343aa86b39c6957f419893eb971 on Android API 30, Pixel 2, 1080x1920 at 420 dpi.

Android product build and public-API analysis: passed, 0 warnings and 0 errors. No diagnostics were suppressed for this build.

dotnet build src/Controls/src/Core/Controls.Core.csproj -f net11.0-android37.0 -p:PublicApiType=Validate --nologo --verbosity quiet

Shell appearance unit tests: 10 passed, 0 failed, 0 skipped.

dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj --no-build --no-restore --filter FullyQualifiedName~ShellAppearanceTests --nologo --verbosity quiet

The unit-test assembly was built with the project's existing warning suppressions plus a local-only suppression of the branch's pre-existing RS0030 errors in unrelated legacy handler-registration tests. No repository analyzer configuration was changed.

Existing Android visual tests: 2 passed, 0 failed. Both the gradient snapshot and the gradient-to-solid-to-default transition snapshots matched the checked-in baselines without changing the tests, baselines, or tolerances.

UseInterpreter=false PublicApiType=Validate pwsh -NoProfile .github/scripts/BuildAndRunHostApp.ps1 -Platform android -DeviceUdid emulator-5554 -TestFilter 'FullyQualifiedName~Issue10445'

UseInterpreter=false avoids a pre-existing .NET 11 outer-build import that otherwise evaluates an empty TargetFrameworkVersion; it does not skip any tests. The initial API 35 run was rejected by the visual-test device guard, so the successful run used the required API 30 device configuration.

Formatting: passed.

dotnet format Microsoft.Maui.sln --no-restore --include src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellBottomNavViewAppearanceTracker.cs --exclude Templates/src --exclude-diagnostics CA1822 --verbosity quiet

API baseline comparison: passed. Zero differences in any shipped or unshipped API file against target merge base 0fa0c4b55f952484d9df62fc51c0d8f4dcd888a5.

Hosted validation is not yet green. Superseded runs include confirmed target-branch failures and other unmatched failures; the passing results above are local validation, not a claim that hosted CI passed. Validation is requested again after each published fix.

Fresh screenshots after the API-neutral rework

Captured from the rebuilt running Android HostApp, not copied from the snapshot baselines. No XCTest or host desktop UI automation was used.

Gradient Changed to solid blue Reset to platform default
Yellow-to-green Shell toolbar and bottom tab bar Shell toolbar and bottom tab bar changed to solid blue Shell toolbar and bottom tab bar reset to platform defaults

Review follow-up and target merge

Merged the latest net11.0 target (4d29977f48783aca35230806110ebcc5d4e325a7) in b9af3abd644, without rebasing or force-pushing. Follow-up commit d2a921a6521 addresses the outstanding Copilot/MauiBot findings, while keeping every shipped and unshipped API baseline identical to the target.

The transition UI test now belongs to Shell1 via ShardedTestCategory and is excluded from Windows, whose Shell bottom tab bar does not consume brushes. The two unsupported Windows transition baselines were removed.

Follow-up validation Result
Shell appearance unit tests 14 passed; weak-subscription stability was also checked in three repeat runs
Native iOS TabbedPage suites, renderer and handler 42 passed, 2 skipped; includes all 10 focused brush/layer/effect regression cases
Native Android repeated-background regression 1 passed; removing material-color preservation produces the intended Assert.Same failure
Existing Android gradient/solid/default visual tests 2 passed, unchanged snapshots and tolerances
Android, iOS, and Mac Catalyst product compilation/API analysis Passed
API-baseline delta and formatting No API changes; formatting passed

The managed lifetime/empty-gradient regressions reproduced three failures before the fix. Native iOS controls reproduced the missing default blur effect before its fix. The final native tests also verify that brush updates use one gradient layer and that solid/default transitions remove it.

Local Apple builds used a temporary, uncommitted SDK override for the installed 26.5 SDK because the updated target pins 27.0. That override was removed afterward. XHarness dependencies were installed only in the session's artifacts; no system runtime or repository build configuration was changed. Android device tests used embedded assemblies rather than fast deployment. No XCTest or host macOS UI automation was used.

Further CI refinements

  • ace99f89ca0 disposes generated Android solid/reveal drawables before replacing them with gradients, while preserving the captured native background. Both disposal controls failed before the fix; all five native Android cases and the two existing Android visual tests pass afterward.
  • e4df3d9be0b propagates in-place solid-brush changes through the existing weak subscription. Four new behavioral cases failed before the fix; all 40 Shell appearance/toolbar tests pass afterward, including empty-brush, override, replacement/removal, and collection checks.
  • c968dd387d7 fixes the PR-owned iOS solid-transition failure observed in UI build 1647311. Setting only UITabBarAppearance.BackgroundColor left the floating bottom tab bar uncolored. The shared helper now also applies the requested color to UITabBar.BackgroundColor; clearing the brush still restores UIKit's default effect and background.
  • 5a3856b0931 keeps weak subscriptions to empty child-brush candidates while an inherited brush is rendered, preserving precedence and deduplicating shared brushes by reference. Five behavioral cases failed before this correction; all 549 managed Shell tests pass afterward.
  • c4ce1caabe7 refreshes toolbar handlers when mutable solid-brush colors change, preserves the configured tab-bar color fallback for unsupported brushes, and removes redundant Shell-side iOS layer cleanup. Three new behavioral cases failed before the fix; all 656 related Shell/toolbar tests pass, including weak-lifetime and replacement/removal checks. Shared, Android, iOS, and Mac Catalyst product builds pass with public-API validation, 0 warnings and 0 errors.
  • e3b2b479d82 retargets equal-colored toolbar brush replacements by reference, weakly observes mutable solid TabbedPage backgrounds on both Apple implementations, and separates Shell's native-appearance capture sentinel from its nullable original tint. Two managed and three native cases fail without these corrections; 658 related managed tests pass, and 45 iOS native tests pass, 2 skipped.
  • 20cead09332 captures and restores distinct UIKit standard/scroll-edge appearances, observes TabbedPage gradient geometry changes, and reuses generated Android gradient drawables while refreshing their shader. Four native controls fail without these corrections; 48 iOS native tests pass, 2 skipped, and all 6 Android native cases pass. Shared, Android, iOS, and Mac Catalyst product builds pass with public-API validation, 0 warnings and 0 errors.
  • 2fff04be9d3 disposes generated Android material/reveal backgrounds after both solid-to-solid replacement paths detach them, while preserving the captured native background and the reveal's start/end colors. All four owned-background cases fail on 20cead09332; all four captured-background controls pass. With the fix, all 14 Android native cases pass in Debug and Release, and all 658 related managed tests pass. The Android product/API build passes with 0 warnings and 0 errors, and every public API baseline remains unchanged.
  • eb8b9a75f77 scopes weak brush subscriptions to each observer registration, preserving independent pivots, value-equal observer instances, and the remaining subscription after one registration is removed. Gradient subclasses without a native Paint representation now fall back to the configured tab-bar color/default. All five new cases fail on the preceding head and pass with the fix; the exact-parent scripted A/B verification reports VERIFICATION PASSED, and all 663 related managed tests pass. Shared, Android, iOS, and Mac Catalyst product/API builds pass with 0 warnings and 0 errors, with no public API changes.
  • 1cb7063f5fe narrows direct native tab-bar view painting to brush-origin backgrounds so legacy Shell.BackgroundColor, Shell.TabBarBackgroundColor, and TabbedPage.BarBackgroundColor keep their prior floating appearance. Clearing a Shell brush restores captured navigation-bar standard/scroll-edge appearances and translucency, including a null original tint. Eight legacy-color controls and two navigation-reset controls reproduce the missing behavior before their corrections; the final iPhone native run passes 58 tests, 2 skipped, and all 663 related managed tests pass. All four product/API builds pass with 0 warnings and 0 errors. No public API, snapshot, or tolerance changes.
  • 6625d009850 includes Catalyst in modern Shell navigation-appearance dispatch, preserves captured non-null native tab-bar view backgrounds during color-origin updates, and uses configured colors/defaults for unsupported TabbedPage brushes in both Apple implementations. Eight new native controls fail on the preceding head and pass with these corrections. The final iPhone native run passes 73 tests, 2 skipped; 663 related managed tests and all four product/API builds pass, with 0 warnings and 0 errors. Catalyst received compilation/API validation only. The existing Windows transition-test guard was verified against evaluated platform constants and left unchanged.
  • 37d93055162 keeps shared Shell background subscriptions active when TabBarBackgroundColor is set, so navigation-bar gradients and mutable solid brushes continue updating without changing tab-bar color precedence. Three managed controls fail before the correction; a native control also reproduces an unchanged rendered navigation-background PNG after a gradient-stop mutation. With the fix the PNG changes while the configured tab-bar color stays green. The final iPhone suite passes 74 tests, 2 skipped; 665 related managed tests and all four product/API builds pass with 0 warnings and 0 errors. No public API, screenshot baseline, or tolerance changes.

The 1cb7063f5fe correction follows actual hosted results: iOS color-only cases in Issues 7396, 16522, and 27846 changed under the earlier unconditional native-view fill; the Issue10445 transition passed its solid-blue step but failed its default navigation-bar reset by 0.64%. The exact Android and Mac Catalyst Issue10445 transition methods passed. These are prior-head results, not a passing hosted result for the new commit.

A supplemental HostApp screenshot rebuild for this follow-up was blocked by CS9057: its validation generator needs Roslyn 5.11, while the installed preview SDK provides 5.9. The declared RTM SDK archive returned 404 from both tried public feeds. Therefore, no new after-screenshots or hosted visual pass is claimed for this follow-up; the screenshots below remain evidence for the earlier changes. Native device tests used the installed iOS 26.5 SDK, not the target's 27.0 SDK. XHarness produced fresh scoped xUnit XML with 58 passed and 2 skipped; the wrapper's older expected-filename check did not recognize that output, so the final run used its declared CLI directly after the script's build-only step and explicit simulator installation. No test harness or analyzer configuration was changed.

The additional scripted Release A/B gate for 2fff04be9d3 returned VERIFICATION INCONCLUSIVE: its baseline reproduced all four ownership failures, but the owned emulator disappeared before the with-fix launch. After recovering the same AVD, the script's freshly built fixed Release APK passed all 14 native cases directly. The scripted attempt itself is not recorded as a pass.

The iOS correction changes one production line and adds native view-color assertions without changing any screenshot baseline or tolerance. Those assertions fail in four solid-background cases without the fix; with the fix, both TabbedPage suites pass 42 tests, 2 skipped, including gradient persistence and solid/default transitions. iOS and Mac Catalyst product builds pass with public-API validation, 0 warnings and 0 errors. Public API files still match the target.

iOS solid-transition evidence

The same existing Issue10445 page was captured on an iPhone 11 Pro simulator running iOS 26.5, using its startup override hook to avoid XCTest/Appium. The observed bottom-bar blue coverage changed from 0.00% to 98.35% in the sampled bottom-bar band. Gradient rendering and native-default restoration were also checked. This is local rendering evidence; the hosted screenshot test is being rerun.

Before: requested blue is missing from the bottom tab bar After: the requested blue is applied
iOS regression: blue navigation bar with an uncolored floating bottom tab bar iOS fix: solid blue navigation bar and bottom tab-bar background

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 37137

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 37137"

@azure-pipelines

This comment has been minimized.

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Aug 6, 2026
@github-actions github-actions Bot added area-controls-shell Shell Navigation, Routes, Tabs, Flyout platform/android platform/ios platform/macos macOS / Mac Catalyst labels Aug 6, 2026
@Dhivya-SF4094 Dhivya-SF4094 changed the title [WIP] [.NET 11] 11Fix shell.Gradient color not working [WIP] [.NET 11] Fix shell.Gradient color not working Aug 6, 2026
@Dhivya-SF4094 Dhivya-SF4094 changed the title [WIP] [.NET 11] Fix shell.Gradient color not working [WIP] [.NET 11] Fix Shell.Gradient color not working Aug 6, 2026
@NirmalKumarYuvaraj NirmalKumarYuvaraj linked an issue Aug 6, 2026 that may be closed by this pull request
@Dhivya-SF4094 Dhivya-SF4094 changed the title [WIP] [.NET 11] Fix Shell.Gradient color not working [.NET 11] Fix Shell.Gradient color not working Aug 10, 2026
@Dhivya-SF4094 Dhivya-SF4094 changed the title [.NET 11] Fix Shell.Gradient color not working [.NET 11] [Shell] Fix gradient background not rendering on bottom tab bar on iOS and Android Aug 10, 2026
@Dhivya-SF4094
Dhivya-SF4094 force-pushed the fix-shellGradientColor branch from d8f4466 to 3d62979 Compare August 10, 2026 10:12
@sheiksyedm
sheiksyedm marked this pull request as ready for review August 10, 2026 10:26
Copilot AI lite review requested due to automatic review settings August 10, 2026 10:26
@azure-pipelines

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates Shell/TabbedPage tab-bar appearance handling so that gradient (and other non-solid) backgrounds can be propagated to the native bottom tab bar on iOS and Android, aligning tab bar rendering with Shell.Background brush support.

Changes:

  • iOS: UpdateiOS15TabBarAppearance now accepts a Paint? and applies gradient backgrounds via UpdateBackground(...).
  • Android: Shell bottom nav appearance tracker now supports brush-based backgrounds (including gradients) and retains an obsolete color-based entry point.
  • Tests: The Issue10445 HostApp page is updated to ensure a bottom tab bar is present (so the gradient scenario can be validated via existing screenshot test).

Reviewed changes

Copilot reviewed 8 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/Core/src/Platform/iOS/TabbedViewExtensions.cs Pass paint/gradient info through iOS 15+ tab bar appearance and apply native background updates.
src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/SafeShellTabBarAppearanceTracker.cs Select tab bar background using TabBarBackgroundColor → Background brush → BackgroundColor precedence (iOS compatibility path).
src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellBottomNavViewAppearanceTracker.cs Add brush-based tab bar background handling (including gradients) and keep an obsolete color-based hook.
src/Controls/src/Core/Shell/ShellAppearance.cs Adjust tab bar background “effective” color behavior to no longer auto-fallback to BackgroundColor.
src/Controls/src/Core/TabbedPage/TabbedPage.iOS.cs Convert TabbedPage bar background color to Paint when calling iOS 15+ appearance helper.
src/Controls/src/Core/Compatibility/Handlers/TabbedPage/iOS/TabbedRenderer.cs Convert compatibility TabbedPage bar background color to Paint when calling iOS 15+ appearance helper.
src/Controls/tests/TestCases.HostApp/Issues/Issue10445.cs Ensure the test Shell shows a bottom tab bar (multiple tabs) so gradient background can be validated visually.
src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt Record the newly introduced SetBackground(BottomNavigationView, Brush) protected virtual API in PublicAPI.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Aug 10, 2026
rmarinho added a commit that referenced this pull request Aug 10, 2026

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Expert Review — 11 findings

See inline comments for details.

MauiBot

This comment was marked as outdated.

@MauiBot MauiBot added the s/agent-changes-requested AI agent recommends changes - found a better alternative or issues label Aug 10, 2026
@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

1 similar comment
@azure-pipelines

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Five unresolved moderate findings remain across Catalyst dispatch, unsupported-brush fallback, Windows test filtering, and preservation of native color-origin backgrounds.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Include Mac Catalyst in iOS 13 appearance dispatch

src/​Controls/​src/​Core/​Compatibility/​Handlers/​Shell/​iOS/​ShellNavBarAppearanceTracker.cs:66

The new Catalyst capture path is enabled above, but this dispatch still checks only iOS/tvOS. On Mac Catalyst, IsIOSVersionAtLeast(13) is false, so SetAppearance takes the legacy UpdateNavigationBarAppearance path and never applies the iOS 13 standard/scroll-edge appearance handling (including brush/gradient rendering). Include the Catalyst version check in this dispatch condition.

Review effort: Lite

Restore captured tab-bar view backgrounds for color-origin updates and honor configured colors for unsupported TabbedPage brushes. Route Catalyst navigation appearances through the same modern UIKit path used for capture and reset.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bcf7f008-bebd-4bf4-b42a-9796e2abf75e
@kubaflo

kubaflo commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Include Mac Catalyst in iOS 13 appearance dispatch.

Fixed in 6625d009850: Catalyst now enters the same modern navigation-appearance path used for native capture/reset. Added standard/scroll-edge assertions for solid, linear, and radial brushes.

The other named areas yielded two concrete corrections: unsupported TabbedPage brushes now use the configured color/default in both Apple implementations, and color-origin updates restore the captured native tab-bar view background instead of always clearing it. Eight native controls fail on the preceding head and pass after these corrections. The final iPhone suite passes 73 tests, 2 skipped; all 663 managed Shell/toolbar tests and four product/API builds pass with 0 warnings/errors. No public API or snapshot/tolerance changes. Local native execution used iOS 26.5; Catalyst received compilation/API validation, not a local runtime claim.

The Windows transition-test guard is already correct: evaluated WinUI constants omit TEST_FAILS_ON_WINDOWS, while Android/iOS include it, so that guarded test is excluded from Windows. The original Windows toolbar-gradient coverage remains intact; no filtering change or check bypass was made.

@kubaflo

This comment has been minimized.

@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

1 similar comment
@azure-pipelines

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

A moderate unresolved subscription issue can leave Shell navigation-bar gradients stale when a tab-bar color override is present.

No open issues 🎉

Review effort: Lite

Observe shared background candidates independently of the tab-bar color override so navigation gradients and mutable solid brushes still refresh. Preserve tab-bar color precedence and detach replaced or removed observer subscriptions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bcf7f008-bebd-4bf4-b42a-9796e2abf75e
@kubaflo

kubaflo commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

A moderate unresolved subscription issue can leave Shell navigation-bar gradients stale when a tab-bar color override is present.

Fixed in 37d93055162. The shared appearance observer must continue observing Shell.Background because it serves navigation bars as well as tab bars; TabBarBackgroundColor still wins for the tab bar, but no longer disables navigation-brush invalidation. Replacement and observer-removal cleanup are unchanged.

Three managed controls fail before the correction, covering mutable solid brushes and gradient overrides applied before/after registration. A native control also fails because the rendered navigation-background PNG remains identical after a gradient-stop mutation. With the fix that PNG changes while the configured green tab-bar color remains unchanged; 74 native tests pass, 2 skipped, and 665 related managed tests pass. Shared, Android, iOS and Mac Catalyst product/API builds pass with 0 warnings/errors. Native execution used iOS 26.5; Catalyst was compile/API-validated only. No public API, screenshot baseline, or tolerance changes.

@kubaflo

This comment has been minimized.

@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

1 similar comment
@azure-pipelines

This comment has been minimized.

@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

A navigation-bar regression test compares separate byte arrays by reference rather than contents, so it can pass without verifying that gradient-stop updates reached the rendered navigation bar.

1 open issue

Review effort: Lite

gradient.GradientStops[0].Color = Colors.Yellow;

using var updatedImage = controller.NavigationBar.StandardAppearance.BackgroundImage.AsPNG();
Assert.NotEqual(initialImage.ToArray(), updatedImage.ToArray());
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 do-not-merge Don't merge this PR partner/syncfusion Issues / PR's with Syncfusion collaboration platform/android platform/ios platform/macos macOS / Mac Catalyst s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shell.Gradient color not working

6 participants