我正在尝试制作简单的应用程序,我想在工具栏中使用搜索,xamarin 拥有SearchHander
对Shell
我来说似乎完美的应用程序。我能够实现它,但搜索列表中返回的结果在项目周围有很多空白区域。我尝试寻找示例并遵循它们,还有来自 Microsoft 文档的示例 xaminals,但没有任何帮助。
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:controls="clr-namespace:App1.controls"
x:Class="App1.MainPage">
<Shell.SearchHandler>
<controls:TitleBarSearchHandler ShowsResults="True" >
<controls:TitleBarSearchHandler.ItemTemplate >
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Label Text="{Binding Nazev}"/>
<Label Text="{Binding Typ}" Grid.Row="1"/>
</Grid>
</DataTemplate>
</controls:TitleBarSearchHandler.ItemTemplate>
</controls:TitleBarSearchHandler>
</Shell.SearchHandler>