diff --git a/src/Controls/src/Core/NavigationPage/NavigationPageToolbar.cs b/src/Controls/src/Core/NavigationPage/NavigationPageToolbar.cs index cb679d4fc62c..54c9ff6e41b9 100644 --- a/src/Controls/src/Core/NavigationPage/NavigationPageToolbar.cs +++ b/src/Controls/src/Core/NavigationPage/NavigationPageToolbar.cs @@ -281,7 +281,7 @@ void ApplyChanges(NavigationPage navigationPage) } Color GetBarTextColor() => _currentNavigationPage?.BarTextColor; - Color GetIconColor() => (_currentPage != null) ? NavigationPage.GetIconColor(_currentPage) : null; + Color GetIconColor() => NavigationPage.GetIconColor(_currentPage) ?? NavigationPage.GetIconColor(_currentNavigationPage); string GetTitle() { diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/OverflowIconShouldBeRed.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/OverflowIconShouldBeRed.png new file mode 100644 index 000000000000..8b07ff27e1a3 Binary files /dev/null and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/OverflowIconShouldBeRed.png differ diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue23563.xaml b/src/Controls/tests/TestCases.HostApp/Issues/Issue23563.xaml new file mode 100644 index 000000000000..9fa3b38d5420 --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue23563.xaml @@ -0,0 +1,21 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue23563.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue23563.xaml.cs new file mode 100644 index 000000000000..fbde7723e9b1 --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue23563.xaml.cs @@ -0,0 +1,18 @@ +namespace Maui.Controls.Sample.Issues; + +[Issue(IssueTracker.Github, 23563, "Unable to set toolbar overflow menu color if not using shell", PlatformAffected.Android)] +public class Issue23563NavPage : NavigationPage +{ + public Issue23563NavPage() : base(new Issue23563()) + { + SetIconColor(this, Colors.Red); + } +} + +public partial class Issue23563 : ContentPage +{ + public Issue23563() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue23563.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue23563.cs new file mode 100644 index 000000000000..43406146b3be --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue23563.cs @@ -0,0 +1,25 @@ +#if ANDROID +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + public class Issue23563 : _IssuesUITest + { + public Issue23563(TestDevice testDevice) : base(testDevice) + { + } + + public override string Issue => "Unable to set toolbar overflow menu color if not using shell"; + + [Test] + [Category(UITestCategories.Navigation)] + public void OverflowIconShouldBeRed() + { + App.WaitForElement("Label"); + VerifyScreenshot(); + } + } +} +#endif \ No newline at end of file