.Net MAUI Search-Bar control issue on iOS devices

104 views Asked by At

I am building a .NET MAUI Android and iOS application and I implemented Search-Bar on a few places in the application.

As for my Android devices, everything works as expected, but the issue occurs when I run my application on iOS. For some reason Search-bar is not displayed at all (in either of those places (popup models, pages etc...))

I tried to fix this by setting SearchBar Style on iOS to Minimal, since I've read this could resolve the issue but it didn't help:

<ContentPage ...
             xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls">
    <StackLayout>
        <SearchBar ios:SearchBar.SearchBarStyle="Minimal"
                   Placeholder="Enter search term" />
        ...
    </StackLayout>
</ContentPage>
1

There are 1 answers

1
Samurai_Jack_Dev On BEST ANSWER

I Managed to resolve this by using Entry instead of SearchBar.

<Entry
    x:Name="SearchEntry"
    Placeholder="Search.."
    TextChanged="OnSearchTextChanged"
    WidthRequest="150"
    HorizontalOptions="Center"
    FontSize="12"/>