androdi 中listview.setTextFilterEnabled(boolean)的作用

官方API注释如下:

Enables or disables the type filter window. If enabled, typing when this view has focus will filter the children to match the users input. Note that the Adapter used by this view must implement the Filterable interface.

 

大概意思就是但listview获得当前焦点的时候,相应用户输入的匹配符。筛选出匹配的listview Items。

 

String[] menus = { "1信息查询", "1信息采集", "2文件上传","2GPS定位功能" };
  setListAdapter(new ArrayAdapter<String>(this,
    android.R.layout.simple_list_item_1, menus));
  getListView().setTextFilterEnabled(true);

 

 

按键盘前listView的值"1信息查询"、"1信息采集、按下键盘2的时候listview里面的值   "2文件上传"、"2GPS定位功能"

posted @ 2012-05-11 15:04  shyscool  阅读(4681)  评论(2编辑  收藏  举报