You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This discussion was converted from issue #20919 on February 29, 2024 16:20.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Description
To be able to set the SetShowsCancelButton property for SearchBar on iOS, without the need to have custom handlers.
Public API Changes
<ContentPage ... xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls"> <StackLayout> <SearchBar ios:SearchBar.ShowsCancelButton="False" Placeholder="Enter search term" /> ... </StackLayout> </ContentPage>
Intended Use-Case
There many cases where you simply do not want to show the "cancel" button. Currently this can be achieved using handlers
#if IOS SearchBarHandler.Mapper.AppendToMapping("CancelButtonColor", (handler, view) => { handler.PlatformView.SetShowsCancelButton(false, false); }); #endif
However, since many developers elect to disable it, it would be nice to have it readily available as a bindable property.
Beta Was this translation helpful? Give feedback.
All reactions