Hello,
When I set WidthRequest
for the HorizontalStackLayout
, it works.
<HorizontalStackLayout WidthRequest="285" Grid.Row="0" Margin="10,10,0,5" HorizontalOptions="Start">
By the way, the searchbar has its own cancel button on iOS/Maccatalyst platforms, you can hide it.
// in MauiProgram class
#if IOS || MACCATALYST
Microsoft.Maui.Handlers.SearchBarHandler.Mapper.AppendToMapping("CancelButtonColor", (handler, view) =>
{
handler.PlatformView.SetShowsCancelButton(false, false);
});
#endif
Best Regards,
Wenyan Zhang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.