标签:
textView.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence chars, int arg1, int arg2,
int arg3) {
}
@Override
public void beforeTextChanged(CharSequence chars, int arg1,
int arg2, int arg3) {
}
@Override
public void afterTextChanged(Editable editable) {
if (editable != null
&& !editable.toString().toUpperCase(Locale.CHINA)
.equals(editable.toString())) {
textView.setText(editable.toString().toUpperCase(
Locale.CHINA));
}
Spannable t = editable;
Selection.setSelection(t, editable.toString().length());
}
});
标签:
原文地址:http://www.cnblogs.com/hanyuchuqing/p/4422656.html