如何在Android应用程序中实现高级搜索框?

问题描述 投票:-1回答:1

我知道我们有SearchView,我也使用它来实现。一切正常。但是它只是从头开始。假设我们在列表中有sunday to monday。如果我们在搜索框中输入s,它将显示sundaysaturday。如果我键入su,它将仅显示sunday,这绝对可以。但是,当我键入turday时,它什么也没显示。但是我想显示saturday,因为星期六有子字符串turday

java android list android-studio searchview
1个回答
0
投票

您需要为其创建基于EditText和RecyclerView的自定义视图。使用editText键入文本,并在其上实现onTextChange Listener。调用onTextChange Listener时,请在list / db / api调用中进行搜索,然后在recyclerView中显示数据。

© www.soinside.com 2019 - 2024. All rights reserved.