Android7.0中文文档(API)--- MultiAutoCompleteTextView
来源:互联网 发布:网上开淘宝店要钱吗 编辑:程序博客网 时间:2024/06/03 20:34
完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/MultiAutoCompleteTextView.html
MultiAutoCompleteTextView
public class MultiAutoCompleteTextView
extendsAutoCompleteTextView
An editable text view, extending AutoCompleteTextView
, that can show completion suggestions for the substring of the text where the user is typing instead of necessarily for the entire thing. AutoCompleteTextView
扩展的可编辑文本视图,它可以显示用户输入的子字符串的补全建议提示,而不是全部的内容。
You must provide a MultiAutoCompleteTextView.Tokenizer
to distinguish the various substrings.
你必须提供一个MultiAutoCompleteTextView.Tokenizer
来分割字符串。
The following code snippet shows how to create a text view which suggests various countries names while the user is typing:
下面的代码片段展示了如何创建一个文本视图,该视图在用户输入时显示不同的国家名称:
public class CountriesActivity extends Activity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.autocomplete_7); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, COUNTRIES); MultiAutoCompleteTextView textView = (MultiAutoCompleteTextView) findViewById(R.id.edit); textView.setAdapter(adapter); textView.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer()); } private static final String[] COUNTRIES = new String[] { "Belgium", "France", "Italy", "Germany", "Spain" }; }
摘要
嵌套类
class
MultiAutoCompleteTextView.CommaTokenizer
This simple Tokenizer can be used for lists where the items are separated by a comma and one or more spaces.
这个简单的Tokenizer可以用于列表,其中的项由逗号和一个或多个空格分隔。
interface
MultiAutoCompleteTextView.Tokenizer
继承XML属性
android.widget.AutoCompleteTextView
android.widget.TextView
android.view.View
继承常量
android.widget.TextView
android.view.View
继承字段
android.view.View
Public构造方法
MultiAutoCompleteTextView(Context context)
MultiAutoCompleteTextView(Context context, AttributeSet attrs)
MultiAutoCompleteTextView(Context context, AttributeSet attrs, int defStyleAttr)
MultiAutoCompleteTextView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public方法
boolean
enoughToFilter()
Instead of filtering whenever the total length of the text exceeds the threshhold, this subclass filters only when the length of the range fromfindTokenStart(CharSequence, int)
togetSelectionEnd()
meets or exceedsgetThreshold()
.
当文本的总长度超过阈值时,它不会过滤,只有当从findTokenStart(CharSequence, int)
到getSelectionEnd()
的范围的长度达到或超过getThreshold()
时,这个子类才会过滤。
- Android7.0中文文档(API)--- MultiAutoCompleteTextView
- Android7.0中文文档(API)--- FrameLayout
- Android7.0中文文档(API)--- DatePicker
- Android7.0中文文档(API) --- MediaController
- Android7.0中文文档(API)--- TabHost
- Android7.0中文文档(API) -- TimePicker
- Android7.0中文文档(API)-- ViewAnimator
- Android7.0中文文档(API)--- AbsoluteLayout
- Android7.0中文文档(API) -- Switch
- Android7.0中文文档(API) --- ToggleButton
- Android7.0中文文档(API) --- RadioButton
- Android7.0中文文档(API) --- CheckedTextView
- Android7.0中文文档(API) -- ScrollView
- Android7.0中文文档(API)-- DigitalClock
- Android7.0中文文档(API)-- TextClock
- Android7.0中文文档(API)---Chronometer
- Android7.0中文文档(API)--- AdapterView
- Android7.0中文文档(API)--- AdapterViewAnimator
- Struts2中的OGNL详解
- 线程的基本概念、线程的基本状态以及状态之间的关系
- 使用SecureCRT连接ubuntu
- javaweb开发优秀资源网站
- 成为Java顶尖程序员 ,看这11本书就够了
- Android7.0中文文档(API)--- MultiAutoCompleteTextView
- Vue填坑之旅2-模拟点击事件
- 区分css的px、em、rem
- iOS开发知识-常用小技巧大杂烩
- 图解正向代理、反向代理、透明代理
- java线程池的使用
- sqlyong导出大批量数据 备份数据库
- OpenTK学习笔记
- 微信小程序 VS 原生App