标签:mystra android textwatcher edittext 监听文本输入
本文地址:http://blog.csdn.net/caroline_wendy
mEditStatus.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { int count = 140 - mEditStatus.length(); mTextCount.setText(Integer.toString(count)); mTextCount.setTextColor(Color.GREEN); if (count < 10) mTextCount.setTextColor(Color.YELLOW); else if (count < 0) mTextCount.setTextColor(Color.RED); } });
标签:mystra android textwatcher edittext 监听文本输入
原文地址:http://blog.csdn.net/caroline_wendy/article/details/41819443