// Always turn on the auto complete input type flag, since it
// makes no sense to use this widget without it.
int inputType = getInputType();
if ((inputType&EditorInfo.TYPE_MASK_CLASS)
== EditorInfo.TYPE_CLASS_TEXT) {
inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE;
setRawInputType(inputType);
}
尽管有这样的评论,我已经取消了旗帜的初步成功,如:
AutoCompleteTextView t = (AutoCompleteTextView)v.findViewById(id);
t.setInputType( t.getInputType() & (~EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE) );
2 回答
我遇到了同样的问题 .
AutoCompleteTextView
构造函数设置InputType
标志EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE
. 我确认这个标志禁止正常的文本建议 . 代码如下:尽管有这样的评论,我已经取消了旗帜的初步成功,如:
我有同样的问题,我建议扩展
AutocompleteTextView
类并在每个构造函数中添加此行: