哪句话是设置了逗号为分隔符哦,只能设置逗号为分隔符么
macTextView.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
macTextView.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
2015-08-14
CommaTokenizer()这个是设置分隔符,自带类只有,号.你也可以自己写一个:想这样
public static class CommaTokenizer_text implements Tokenizer {
public int findTokenStart(CharSequence text, int cursor) {
int i = cursor;
while (i > 0 && text.charAt(i - 1) != ',') {
i--;
}
while (i < cursor && text.charAt(i) == ' ') {
i++;
}
return i;
}
把逗号换成你自己定义的就可以了,然后去调用它macTextView.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer_text());
举报