创建选择下拉选择器以在Xamarin中筛选数值

huangapple go评论90阅读模式
英文:

Create select dropwdown picker to filter values in xamarin

问题

我希望用户从列表中选择他们的症状。这将是一个非常长的列表,所以我希望能够进行筛选,同时也要有适当的下拉选择项。类似于这样的东西:

创建选择下拉选择器以在Xamarin中筛选数值

有Xamarin.Forms Picker(https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/picker/),但它只能显示一个列表以供选择,对吗?没有输入的可能性。

如何在Xamarin Forms中实现类似图片的东西?

英文:

I want user to select their symptoms from a list. It is gonna be a very long list so I would like to filter it but at the same time have proper dropdown select item. Something like this:

创建选择下拉选择器以在Xamarin中筛选数值

There is Xamarin.Forms Picker (https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/picker/) but it can only display itewms in a list to select, right? No possibility to input.

How can I achieve something similar like picture in Xamarin Forms?

答案1

得分: 1

您可以使用搜索栏或Xamarin.Forms Shell搜索来实现您想要的元素。

<SearchBar Placeholder="搜索项目..."
           CancelButtonColor="橙色"
           PlaceholderColor="橙色"
           TextColor="橙色"
           TextTransform="小写"
           HorizontalTextAlignment="居中"
           FontSize="中号"
           FontAttributes="斜体" />

更多信息,您可以参考Xamarin.Forms SearchBar

英文:

You can use the searchbar or the Xamarin.Forms Shell search to realize the element you want.

&lt;SearchBar Placeholder=&quot;Search items...&quot;
           CancelButtonColor=&quot;Orange&quot;
           PlaceholderColor=&quot;Orange&quot;
           TextColor=&quot;Orange&quot;
           TextTransform=&quot;Lowercase&quot;
           HorizontalTextAlignment=&quot;Center&quot;
           FontSize=&quot;Medium&quot;
           FontAttributes=&quot;Italic&quot; /&gt;

More information you can refer to Xamarin.Forms SearchBar.

huangapple
  • 本文由 发表于 2023年3月10日 01:26:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/75688062.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定