一、设置EditText只显示一行
android:maxLines=“1”
android:singleLine=“true”
android:inputType=“text”
二、监听输入
private TextWatcher BTNameOutSizeListener = 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) {
xxx添加处理
};
初始化时mBtNameEdit.addTextChangedListener(BTNameOutSizeListener);