标签:
editText.setFilters(new InputFilter[]{filter}); private InputFilter filter=new InputFilter() { @Override public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { //返回null表示接收输入的字符,返回空字符串表示不接受输入的字符 if(source.equals(" ")) return ""; else return null; } };
注:得到了预期的结果
标签:
原文地址:http://www.cnblogs.com/butterfly-clover/p/5453447.html