maui
maui copied to clipboard
[Mac Catalyst] Setting CancelButtonColor on SearchBar has no effect when using Mac Idiom
Description
When adopting the Mac Idiom for a Mac Catalyst app, setting the CancelButtonColor
on the SearchBar does not change the color of the cancel button.
Steps to Reproduce
-
Create a File > New .NET MAUI app
-
Specify the use of Mac Idiom as per the Specify the UI idiom for your Mac Catalyst app documentation
-
Update the templated
MainPage.xaml
to include a SearchBar and explicitly set theCancelButtonColor
toRed
. For example:<VerticalStackLayout HorizontalOptions="Center" VerticalOptions="Center" Spacing="20"> <SearchBar CancelButtonColor="Red" /> </VerticalStackLayout>
Expected
The color of the cancel button is Red
.
Actual The color of the cancel button is not updated (default still applies).
Link to public reproduction project repository
No response
Version with bug
7.0.96
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
macOS
Affected platform versions
Ventura 13.6
Did you find any workaround?
Append to mapping to set the (UISearchBar) TintColor
value based on the virtual view CancelButtonColor
value.
SearchBarHandler.Mapper.AppendToMapping("UISearchBarTintColorWorkaround", (handler, view) =>
{
handler.PlatformView.TintColor = view.CancelButtonColor.ToPlatform();
});
Relevant log output
No response
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.