Android7.0中文文档(API)--- MultiAutoCompleteTextView

完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/MultiAutoCompleteTextView.html

MultiAutoCompleteTextView

public class MultiAutoCompleteTextView
extends AutoCompleteTextView

java.lang.Object
   ↳android.view.View
    ↳android.widget.TextView
     ↳android.widget.EditText
      ↳android.widget.AutoCompleteTextView
       ↳android.widget.MultiAutoCompleteTextView
已知的直接子类


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" }; }

摘要


嵌套类

classMultiAutoCompleteTextView.CommaTokenizer

This simple Tokenizer can be used for lists where the items are separated by a comma and one or more spaces. 
这个简单的Tokenizer可以用于列表,其中的项由逗号和一个或多个空格分隔。 

interfaceMultiAutoCompleteTextView.Tokenizer

 

继承XML属性

From class android.widget.AutoCompleteTextView
From class android.widget.TextView
From class android.view.View

继承常量

From class android.widget.TextView
From class android.view.View

继承字段

From class 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方法

booleanenoughToFilter()

Instead of filtering whenever the total length of the text exceeds the threshhold, this subclass filters only when the length of the range from findTokenStart(CharSequence, int) to getSelectionEnd() meets or exceeds getThreshold().
当文本的总长度超过阈值时,它不会过滤,只有当从findTokenStart(CharSequence, int)getSelectionEnd()的范围的长度达到或超过getThreshold()时,这个子类才会过滤。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值