Forum Xamarin.Forms

Shell Search handler not showing in page

iooovoltsiooovolts Member ✭✭✭
edited October 2019 in Xamarin.Forms

I have a page where the shell handler is not showing. And I am wondering if it is because if has been navigated to? It is not one of the base Shell Tab pages.

View 1 -> View 1 -> View 3. In my case it is View 3 is where I have put the SearchHandler and it is not showing on the toolbar. I am using Prism Mvvm.

Search Handler xaml

    <Shell.SearchHandler>
        <SearchHandler Query="{Binding Query}"
                       SearchBoxVisibility="Collapsible"
                       Placeholder="Search tasks"/>
    </Shell.SearchHandler>

Answers

  • LandLuLandLu Member, Xamarin Team Xamurai

    On iOS, if you set the SearchBoxVisibility to Collapsible the search bar will be collapsed. You need to use Expanded style to show it directly:

    <Shell.SearchHandler>
        <SearchHandler Query="{Binding Query}"
                        SearchBoxVisibility="Expanded"
                        Placeholder="Search tasks"/>
    </Shell.SearchHandler>
    

    However, if you do want this style scroll down to make it visible. I know there will be a search icon at the right top corner of the page to expand the search bar on Android. But each platform has its own features:

  • iooovoltsiooovolts Member ✭✭✭

    I am debugging in android, so yes you are correct it shows the search icon, it works on another page. It just does not show o pages I have navigated to.

    I have tried all SearchVisibility types.

  • LandLuLandLu Member, Xamarin Team Xamurai

    You can see this detail page is navigated from the items page and the search bar icon displays on Android.
    Try to make a sample and share it here to help me reproduce your issue.

  • iooovoltsiooovolts Member ✭✭✭

    @LandLu Did you navigate using shell navigation? I navigated using Prism Navigation maybe that is why, using Prism's NavigationService. I am no longer using Shell for now for other reasons but thanks so much for your help!!

  • LandLuLandLu Member, Xamarin Team Xamurai

    I'm not using Prism. If the default shell doesn't exist this issue I think this should be the Prism's missions.
    You'd better raise an issue beneath the Prism's GitHub:
    https://github.com/PrismLibrary/Prism
    Ask the support whether it completely supports Shell now.

  • Angelru9Angelru9 ESMember ✭✭✭
    edited June 9

    @iooovolts I think a navigation bar is needed

Sign In or Register to comment.