How do I remove popup text from listview filter?

前端 未结 2 852
面向向阳花
面向向阳花 2020-12-11 17:32

I\'m using a text filter on a ListView and I\'d like to get rid of the popup view that shows what the filter text is. Is there any way to remove this view?

Some exam

2条回答
  •  既然无缘
    2020-12-11 18:12

    Try to do this change

    @Override
            public boolean onQueryTextChange(String newText) {
                System.out.println("tap");
                yourAdapter ca = (yourAdapter)listview.getAdapter();
    
                if (TextUtils.isEmpty(newText)) {
                    System.out.println("isEmpty");
                    //listview.clearTextFilter();  
                    ca.getFilter().filter(null);
                } else {
    
                    ca.getFilter().filter(newText);
                    //listview.setFilterText(newText);
    
                }
                return true;
            }
    

提交回复
热议问题