Xamarin.Forms 自动完成跨平台

Xamarin.Forms 自动完成跨平台

问题描述:

我是 Xamarin.Forms 平台的新手.我希望你能帮助我继续前进.我想在 xamarin.forms 中有一个像自动完成这样的控件,如下所示

I am a newbie to Xamarin.Forms Platform. I hope you can help me in moving ahead. I want to have a control like autocomplete in xamarin.forms like below

能否请您指导如何在 Xamarin.Forms 中实现?我想用入口控制来实现它

Can you please guide how can it be achievable in Xamarin.Forms? I want to achieve it with the Entry Control

TIA

您没有包含您想要的内容,只是某种自动完成.

You haven't included what exactly you want, just some sort of autocomplete.

我将重点介绍项目列表的一般手动方法:

I'll bullet point the Manual way to do it in general for a List of items:

  1. 使用 TextBox 允许用户输入文本.
  2. 使用列表将所有对象及其可搜索属性(例如对象名称)收集在一起.
  3. 当用户在 TextBox 中键入内容时,应用应在 List 中搜索在 TextBox 中输入的字符串.
  4. 建议应根据键入的字符串值显示在 TextBox 下的 ListView 中.
  5. 用户点击 ListView 项目,这是一个建议,然后通过将对象名称从点击的项目中获取到文本框来自动完成.

无需上述冗长粗略程序即可进行自动完成的一般方法是使用 Android AutoCompleteTextView.

A general way of doing autocomplete without the long rough procedure above is to use the Android AutoCompleteTextView.

您仍然可以使用基本逻辑在 Xamarin Forms 中执行此操作.

You can still use the basic logic to do it in Xamarin Forms.

此处查看适用于 Android 的 AutoCompleteTextView.查看此处此处此处 获取有关 Xamarin Forms 中自动完成的帮助.

Look here for the AutoCompleteTextView for Android. Look here, here and here for help with AutoComplete in Xamarin Forms.