底部显示"d"
的小盒子叫什么?如何在过滤后的SearchView
中启用它?它还能用在哪里呢?
它可能是某种Toast
吗?我看了一遍又一遍API源代码,但找不到如何定义它。
发布于 2012-03-24 23:09:20
这是PopupWindow http://developer.android.com/reference/android/widget/PopupWindow.html。您不需要启用它。当您将ListView设置为时,默认情况下会使用它
listView.setTextFilterEnabled(true);
当您设置或清除筛选器文本时,将显示PopupWindow
listView.setFilterText("d");
发布于 2012-05-22 19:59:46
我发现了如何摆脱那个丑陋的弹出窗口。诀窍是使用下面的filter directly.The代码,假设您已经在customAdapter中实现了filterable。
public boolean onQueryTextChange(String newText) {
if (TextUtils.isEmpty(newText)) {
m_listView.clearTextFilter();
} else {
ContactsAdapter ca = (ContactsAdapter)lv.getAdapter();
ca.getFilter().filter(newText);
//following line was causing the ugly popup window.
//m_listView.setFilterText(newText);
}
return true;
}
发布于 2012-03-24 22:57:26
据我所知,它只是重复你作为搜索关键字输入的内容。如果你有一个没有文本框的列表来输入你的搜索键,那么知道你输入了什么是非常方便的。悬崖
https://stackoverflow.com/questions/9855894
复制相似问题