Android 自动完成文本视图过滤

发布于 2024-10-06 15:06:21 字数 223 浏览 0 评论 0原文

我有一个AutoCompleteTextview,但默认过滤对我来说不好。

例如:字符串 "hum" 应该与 Hohum Plumbing、Humphrey Bogart 和 Robert Mitchum 匹配,但目前还没有发生。

目前,我正在传递 ArrayList 并创建适配器。现在我如何自定义过滤?

I have an AutoCompleteTextview but default filtering is not good for me.

eg: The string "hum" should match to Hohum Plumbing, Humphrey Bogart, and Robert Mitchum, but currently, it is not happening.

Currently, I am passing ArrayList and creating adapter. Now how can I customize the filtering?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

酒废 2024-10-13 15:06:21

在这种情况下,您必须为附加到 AutoCompleteTextView 适配器的过滤器创建自己的 runQuery 实现。

In that case, you have to make your own runQuery implementation for the filter attached to your AutoCompleteTextView's adapter.

橘和柠 2024-10-13 15:06:21

也许你应该看看这里

或创建您自己的自定义控件
此处

Maybe you should take a look at here

or create you own custom control
here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文