-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS][Regression] Fix ToolbarItem color when used with IconImageSource is always default color #26048
Conversation
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regression is due this change https://github.com/dotnet/maui/pull/22437/files#diff-48977a1f6983e847819315f0fcab9bc88a0bf15ba282e24616895a7c65713774 and impact:
- ToolbarItems
- Menus (icons). See:
return fontImageSource.GetPlatformImage(fontManager, 1);
Could we fix also the menus in this PR?
|
||
|
||
<ContentPage.Content> | ||
<Label Text="ToolbarItemIconColorTest" AutomationId="Label"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could modify the sample to change the ToolbarItem color at runtime?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per your suggestion, I have modified the test case. Could you please validate the changes?
src/Controls/src/Core/Compatibility/iOS/Extensions/ToolbarItemExtensions.cs
Show resolved
Hide resolved
The issue does not occur when using IconImageSource with MenuItem. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Root cause
The regression occurred because a previous PR changed the UIImageRenderingMode to Automatic, which caused the ToolbarItem icon to ignore the FontImageSource.Color.
Description of Change
To address this issue, the TintColor is explicitly set to the platform-specific equivalent of FontImageSource.Color. This ensures the toolbar icon respects and correctly displays the specified color.
Regressed PR
Issues Fixed
Fixes #25912
Tested the behaviour in the following platforms
Output Screenshot