Repository navigation
Description
Description
When using a SwipeItem with IconImageSource on Android, the icon becomes black on a black background in Dark Mode when running with Microsoft.Maui.Controls 10.0.90.
The issue can be reproduced using the sample from issue #36736 with an SVG image assigned to SwipeItem.IconImageSource.
In Microsoft.Maui.Controls 10.0.80 and earlier, the SwipeItem is displayed with a white background and a black icon, making the icon clearly visible.
In Microsoft.Maui.Controls 10.0.90, the SwipeItem background becomes black while the icon also remains black. As a result, the icon has little or no contrast against the background and becomes difficult to see.
The same SVG file, application code, Android emulator, and device settings were used for all tests. The only change was the Microsoft.Maui.Controls version.
The issue was reproduced on Android 14, Android 15, and Android 16 while the device was configured to use Dark Mode.
Attached screenshots compare the behavior of Microsoft.Maui.Controls 10.0.80 and 10.0.90.
Expected behavior:
The SwipeItem IconImageSource should remain clearly visible regardless of whether the device is using Light Mode or Dark Mode.
Actual behavior:
In Dark Mode with Microsoft.Maui.Controls 10.0.90, the icon is rendered as black on a black background, resulting in insufficient contrast and poor visibility.
Steps to Reproduce
-
Create a new .NET MAUI application.
-
Replace MainPage.xaml and MainPage.xaml.cs with the sample provided in issue [Android][Regression] SwipeItem Text and IconImageSource are vertically misaligned when SwipeView wraps CollectionView #36736.
-
Add the following SVG image to:
Resources/Images/ic_fluent_arrow_circle_left_24_filled.svg
https://all.undo.jp/ic_fluent_arrow_circle_left_24_filled.svg -
Update Microsoft.Maui.Controls to 10.0.90.
-
Configure the Android emulator to use Dark Mode.
-
Run the application.
-
Swipe the CollectionView to reveal the SwipeItem.
-
Observe the SwipeItem IconImageSource.
-
Repeat the same test using Microsoft.Maui.Controls 10.0.80.
-
Compare the results between 10.0.80 and 10.0.90.
Observed result:
- 10.0.80: white background with visible black icon.
- 10.0.90: black background with black icon.
The issue is reproducible consistently.
Link to public reproduction project repository
No response
Version with bug
10.0.90
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
10.0.80
Affected platforms
Android
Affected platform versions
Android 14/15/16
Did you find any workaround?
No.
The only known way to avoid the issue is to use Microsoft.Maui.Controls 10.0.80 or earlier.
Activity
NafeelaNazhir commentedon Jul 24, 2026
This issue has been validated in Visual Studio Code 1.129.0 with .NET MAUI versions 10.0.80 and 10.0.90. It can be reproducible on Android platform from 10.0.90 version.
Issue36766.zip
sheiksyedm commentedon Jul 28, 2026
@kamano1 As per my analyze, the reported issue is not a regression; it is a behavior change.
Previously, the swipe item icon color was determined by the swipe item's background color rather than the color defined in the SVG icon. For example, if the swipe item background was white, the icon would appear black. If the background was black, the icon would appear white, even when the SVG icon's fill color was explicitly set to Red.
This issue was addressed in PR #35632. With this change, the swipe item icon color is now rendered based on the color defined in the SVG file. This behavior is consistent with other platforms and with Xamarin.
In your case, the icon color defined in the SVG file is #212121. As a result, that color is applied in both Light and Dark modes.
@PureWeen @kubaflo : Could you please confirm whether including this behavior change in a service release is appropriate?
Many users expect the icon color specified in the SVG file to be respected rather than having it automatically adjusted based on the background color. So that, this changes included on SR9. However, if this change affects existing users, we can revert PR #35632 in the service release and move the behavior change to .NET 11 release. Along with that, we could introduce explicit swipe icon color support, allowing users to apply icon colors based on theme changes instead of relying on the original SVG icon color.
kubaflo commentedon Jul 28, 2026
Thanks for digging into this @sheiksyedm — but I don't think this should stay in servicing. A couple of corrections first, then my recommendation.
"Consistent with Xamarin" isn't accurate
Xamarin.Forms applied the auto-contrast tint unconditionally to every icon, on both platforms:
SwipeViewRenderer.cs#L858—drawable.SetColorFilter(textColor.ToAndroid(), FilterMode.SrcAtop);, wheretextColor = GetSwipeItemColor(formsSwipeItem.BackgroundColor)— a luminosity-based white/black pick (L906–910)SwipeViewRenderer.cs#L713-715—AlwaysTemplate+TintColor = GetSwipeItemColor(swipeItem.BackgroundColor)So the pre-#35632 MAUI behavior was the Xamarin behavior. #35632 is a departure from Xamarin, not alignment with it.
"Consistent with other platforms" doesn't hold either
Before #35632, every platform auto-contrast-tinted the icon:
SetColorFilter(GetTextColor(), SrcAtop)on every drawableAlwaysTemplateon every image +TintColor = fontImageSource.Color ?? GetTextColor()ToIconSource()produced aBitmapIconSource, whoseShowAsMonochromedefaults totrue, so the bitmap rendered as a mask inForeground— whichUpdateTextColorset toTextColor ?? GetTextColor()That's precisely why #35632 had to change all three handlers, and why the Windows fix was swapping
BitmapIconSource→ImageIconSource(the only way out ofShowAsMonochrome). MAUI was uniform before and is uniform after — consistency isn't the differentiator here. The differentiator is that the old uniform behavior matched Xamarin and guaranteed legibility, and the new one doesn't.The auto-contrast was deliberate, and we only half-removed it
GetTextColor()insrc/Core/src/Platform/SwipeViewExtensions.cspicks white or black from background luminosity. It's a legibility guarantee, not legacy accident. #35632 removed it for PNG/SVG but left it in place for the label text — so the item's text is still contrast-corrected while its icon isn't. The end state is internally inconsistent.It compounds with #36271
#36271 (also SR9) makes
BackgroundColorcorrectly followAppThemeBinding, so the item legitimately goes dark in dark mode. Before SR9 the stale light background accidentally preserved contrast. Individually each change is defensible; together they produce genuinely invisible black-on-black, which is what @kamano1 is seeing. #36573 is a third open regression in this same code path, also milestoned SR10.The part that decides it for me
#23074 is labelled
proposal/open— a feature request, and its title literally asks for more configuration. What shipped is a behavior change with no configuration: there's noIconColoror tint opt-out, so an affected app's only options are pinning to 10.0.80 or re-authoring every SVG per theme. That's not an acceptable servicing outcome regardless of which behavior is "more correct", and it's why thei/regression+regressed-in-10.0.90labels here are right.Recommendation
Revert #35632 from
inflight/currentfor SR10, and keep/land it onnet11.0paired with the explicit swipe-icon color/tint API you proposed. That puts the more-correct behavior where a breaking change is allowed and gives users a real opt-in, instead of a silent rendering change in a patch release.#36573 should stay on SR10 — that one is a genuine bug in the theme-refresh path and is worth fixing independently.
Revert "Fix SwipeItem IconImageSource color handling and rendering ac…
kubaflo commentedon Jul 28, 2026
Fixed for SR10. Summary of where this landed and why.
What was wrong
This was a real regression, not just a behavior change. Two SR9 changes combined:
SwipeItem.BackgroundColorcorrectly followAppThemeBinding.Before SR9, the stale light background accidentally preserved contrast. Together, the two produce black-on-black: an SVG whose fill is
#212121on a dark background is effectively invisible.Worth correcting one point from the earlier analysis — the previous tinting was not an Android-only inconsistency, and it was not divergent from Xamarin. Xamarin.Forms tinted every swipe icon unconditionally on both Android and iOS, and MAUI tinted on all three platforms (Windows via
BitmapIconSource, whoseShowAsMonochromedefaults totrue) — which is why #35632 had to touch all three handlers.What we did
Servicing (SR10) — reverted. #36887 is merged into
inflight/candidate. The pre-SR9 tinting behavior is restored on Android, iOS/Mac and Windows, soIconImageSourceicons are legible against their background again in both themes.The direction of #35632 is right, but it shipped as a silent rendering change in a patch release with no opt-out. Affected apps had no option other than pinning to 10.0.80 or re-authoring every SVG per theme. It also removed a legibility guarantee only for icons while leaving the item's label text contrast-corrected, which is inconsistent on its own. And #23074, the issue #35632 addressed, was labelled
proposal/open— a request for more configuration, not a bug report..NET 11 — kept, with a real opt-in. #36884 reinstates the #35632 behavior and adds an explicit
SwipeItem.IconColorproperty:IconColorunset → previous auto-contrast tinting (unchanged from today's servicing behavior)IconColorset → that color is used as the tintIconColor="Transparent"→ no tint; the icon renders in its authored colorsIconColoris a regular bindable property, so it works withAppThemeBindingfor per-theme icon colors.For anyone hitting this now
Until SR10 ships, setting an explicit non-theme-following
BackgroundColoron the affectedSwipeItemrestores contrast. On .NET 11 you'll be able to useIconColor="Transparent"to opt into authored SVG colors deliberately.Thanks @kamano1 for the clear report and repro.
[NET 11] SwipeItem: Add explicit IconColor and TextColor (#36884)