问题描述
我有ListView的活动。这ListView的包含的ImageView和两个textViews(又名姓和名)。我想组织(按姓氏例如)通过的TextView之一,这个搜索的ListView。
我怎样才能实现呢?
I have activity with ListView. That listView contains imageView and two textViews (aka first and last names). I want to organize searching with this listView by one of textView (e.g. by last name).How can I implement that?
我发现,快速搜索框可以使用,但我不知道如何使用它。
I found that Quick Search Box can be used but I didn't understand how to work with it.
帮助,PLZ:)
推荐答案
您可以使用 setTextFilterEnabled(布尔)
方法。
如果它不能解决你的问题,那么你也可以定义自己的过滤器。
If it does not solve your problem then you can also define your own filter.
有关此,请看到这个帖子android-how-do-i-overwrite-the-filter-for-my-arrayadapter
For this please see this post android-how-do-i-overwrite-the-filter-for-my-arrayadapter
希望这有助于!
这篇关于Android系统。搜索在LISTVIEW的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!