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 @@ -7,6 +7,7 @@
using System.Windows.Input;
using CoreGraphics;
using Foundation;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Graphics.Platform;
using UIKit;
using static Microsoft.Maui.Controls.Compatibility.Platform.iOS.AccessibilityExtensions;
Expand Down Expand Up @@ -498,13 +499,13 @@ void UpdateLeftToolbarItems()

UIImage? icon = null;

var foregroundColor = _context?.Shell.CurrentPage?.GetValue(Shell.ForegroundColorProperty) as Color ??
_context?.Shell.GetValue(Shell.ForegroundColorProperty) as Color;

if (image is not null)
{
icon = result?.Value;

var foregroundColor = _context?.Shell.CurrentPage?.GetValue(Shell.ForegroundColorProperty) ??
_context?.Shell.GetValue(Shell.ForegroundColorProperty);

if (foregroundColor is null)
{
icon = icon?.ImageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal);
Expand Down Expand Up @@ -542,6 +543,16 @@ void UpdateLeftToolbarItems()
{
NavigationItem.LeftBarButtonItem =
new UIBarButtonItem(icon, UIBarButtonItemStyle.Plain, (s, e) => LeftBarButtonItemHandler(ViewController, IsRootPage)) { Enabled = enabled };

// For iOS 26+, explicitly set the tint color on the bar button item
// because the navigation bar's tint color is not automatically inherited
if (OperatingSystem.IsIOSVersionAtLeast(26) || OperatingSystem.IsMacCatalystVersionAtLeast(26))
{
if (foregroundColor is not null)
{
NavigationItem.LeftBarButtonItem.TintColor = foregroundColor.ToPlatform();
}
}
}
else
{
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue32867.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 32867, "Shell Flyout Icon is always black", PlatformAffected.iOS)]
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

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

According to the UI Testing Guidelines, the PlatformAffected should be set based on actual platform limitations. The PR description mentions both iOS and macOS are affected by the same tint inheritance issue, but the [Issue] attribute only specifies PlatformAffected.iOS. Consider whether this should be PlatformAffected.iOS | PlatformAffected.macOS since the fix applies to both platforms (line 535 checks for both IsIOSVersionAtLeast(26) and IsMacCatalystVersionAtLeast(26)).

Copilot generated this review using guidance from repository custom instructions.
public class Issue32867 : Shell
{
public Issue32867()
{
// Create a simple ShellContent with a content page
var shellContent = new ShellContent
{
Title = "Home",

Content = new Issue32867Page()
};
FlyoutBehavior = FlyoutBehavior.Flyout;
FlyoutIcon = "shopping_cart.png";
Items.Add(shellContent);

// Set Shell ForegroundColor (affects FlyoutIcon tint)
Shell.SetForegroundColor(this, Colors.Red);
}
}
public class Issue32867Page : ContentPage
{
public Issue32867Page()
{
Content = new VerticalStackLayout
{
Padding = 20,
Spacing = 10,
Children =
{
new Label
{
Text = "The test passes if the Flyout icon appears in red (not black).",
AutomationId = "Issue32867Label"
},

}
};
}
}
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,22 @@
#if TEST_FAILS_ON_WINDOWS // https://github.com/dotnet/maui/issues/26148
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue32867 : _IssuesUITest
{
public Issue32867(TestDevice testDevice) : base(testDevice)
{
}
public override string Issue => "Shell Flyout Icon is always black";

[Test]
[Category(UITestCategories.Shell)]
public void ShellFlyoutIconShouldNotBeBlack()
{
App.WaitForElement("Issue32867Label");
VerifyScreenshot();
}
}
#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