2017-03-24 62 views
0

顶部简而言之,这是我的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> 

的代码,但我想添加页面的搜索栏上方,蓝条。我怎样才能做到这一点?

enter image description here

+0

简答:这是不可能的。你必须自己创建它。 – Farid

回答

2

请参阅此以下link为MaterialSearchView。

此外,对于使用不同的搜索功能,请参阅this link

希望它能帮助。

+0

@eaege如果您发现此答案有帮助,请接受答案,以便其他人获益,谢谢。 –

2

所以基本上你想要在导航栏顶部的搜索栏。为此,您必须执行自定义渲染。找到这个blog link来实现这一目标:

Github source link

希望这有助于!