简体   繁体   中英

Android: what does “setTextFilterEnabled” method do?

setTextFilterEnabled()方法有什么作用?

It basically enables filtering for the contents of the given ListView. However, the caveat, as explained here is that the filtering doesn't happen automatically. According to that link, you have to provide the filtering logic and then according to the AbsListView docs that outline that method, the adapter you call that method on must also implement Filterable .

Hope that helps...

According to the Android Developer Reference, the setTextFilterEnabled() method "enables or disables the type filter window. If enabled, typing when this view has focus will filter the children to match the users input."

Source and extra information can be found at the Android Developer Reference, ie : http://developer.android.com/reference/android/widget/AbsListView.html#setTextFilterEnabled%28boolean%29

它用于过滤给定ListView的内容。当您键入一个字母时,如果该视图中存在该项,您将自动滚动到该项。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM