Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在页面顶部添加搜索栏_Android_Xamarin_Xamarin.forms_Searchbar - Fatal编程技术网

Android 如何在页面顶部添加搜索栏

Android 如何在页面顶部添加搜索栏,android,xamarin,xamarin.forms,searchbar,Android,Xamarin,Xamarin.forms,Searchbar,简而言之,这是我的Xamarin HomePage.xaml的代码 <ContentPage> <StackLayout> <SearchBar x:Name="mySearchBar" SearchButtonPressed="mySearchBar_ButtonPressed"> </SearchBar> </StackLayout>

简而言之,这是我的Xamarin HomePage.xaml的代码

<ContentPage>

 <StackLayout>
        <SearchBar
            x:Name="mySearchBar"
            SearchButtonPressed="mySearchBar_ButtonPressed">
        </SearchBar>
    </StackLayout>
        <ScrollView>
            <StackLayout>
               <!-- Label and entries here -->
                <StackLayout>
                    <!-- Label and entries here -->
                </StackLayout>
                 <!-- Buttons and a listview here -->
            </StackLayout>
        </ScrollView>
    </ContentPage>

但我想在页面顶部添加搜索栏,蓝色栏。我该怎么做


有关材料搜索视图,请参阅以下内容。

有关使用不同搜索功能的信息,请参阅。


希望对您有所帮助。

有关MaterialSearchView,请参阅以下内容。

有关使用不同搜索功能的信息,请参阅。


希望有帮助。

所以基本上你希望搜索栏位于导航栏的顶部。为此,必须执行自定义渲染。找到这一点来实现这一点:


希望这有帮助

所以基本上您希望搜索栏位于导航栏的顶部。为此,必须执行自定义渲染。找到这一点来实现这一点:


希望这有帮助

@eaege如果你觉得这个答案有帮助,一定要接受这个答案,这样别人会受益,谢谢。@eaege如果你觉得这个答案有帮助,一定要接受这个答案,这样别人会受益,谢谢。简短回答:这是不可能的。你必须自己创造它。简短的回答:这是不可能的开箱即用。你必须自己创造它。