问题
If I want to enter a message into an editText, I enter some digits and my keyboard looks like that:
but after I add some text from code by clicking the button (et.setText(et.getText().toString() + " " + "abc")), keyboard changes to:
is there a way to prevent this happening?
回答1:
I've used editable.append instead of et.setText() and this works
回答2:
You should set input type in your EditText (for example by using "android:inputType" in xml file containing the layout).
See: http://developer.android.com/reference/android/widget/TextView.html#attr_android:inputType
来源:https://stackoverflow.com/questions/10091390/android-edittext-keyboard-changed-after-settext