我创建了一个AutoCompleteTextView
下拉列表,其中包含多行中的单词,如 -
row 1 - Infosys Limited
row 2 - State Bank of India
当我进入Infosys时,当我在下拉菜单关闭后进入空间时,它可以正常工作。
ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, GreenDaoUtils.getSSSymbolNamesArray(this));
autoCompleteTextView.setAdapter(adapter);
autoCompleteTextView.setLines(8);
autoCompleteTextView.setDropDownBackgroundDrawable(getResources().getDrawable(R.drawable.cust_rect_border));
autoCompleteTextView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(final AdapterView<?> parent, final View view, final int position, long id) {
});
}
});
答案 0 :(得分:0)
使用 FilterWithSpaceAdapter 代替ArrayAdapter
你来自FilterWithSpaceAdapter here
FilterWithSpaceAdapter<String> adapter1;
adapter1 = new FilterWithSpaceAdapter<String>(this, android.R.layout.simple_list_item_1, GreenDaoUtils.getSSSymbolNamesArray(this));