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定位功能"


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM