AutoCompleteTextView控件的使用

 

An editable text view that shows completion suggestions automatically while the user is typing. The list of suggestions is displayed in a drop down menu from which the user can choose an item to replace the content of the edit box with.

The drop down can be dismissed at any time by pressing the back key or, if no item is selected in the drop down, by pressing the enter/dpad center key.

The list of suggestions is obtained from a data adapter and appears only after a given number of characters defined by the threshold.

这是一个当用户输入的时候可以显示完成建议的可编辑text示图。列表建议会在一个下拉菜单中显示,从中用户可以选择一个选项,下拉菜单当用户按下了返回健时可以在任何时候被取消。

列表建议是从数据适配器中得到数据的。但是仅仅会在输入了一个给定的输入字符数目时才会显示,可用threshold来定义给定的输入字符。

例子:

 

 

main.xml

 

AutoTextActivity.java

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值