原文:https://blog.csdn.net/uyy203/article/details/54445267
//点击回车事件
mDescriContent.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if(event.getKeyCode()==KeyEvent.KEYCODE_ENTER){
Toast.makeText(getContext(), "不可以换行哦", Toast.LENGTH_SHORT).show();
return true;
}else{
return false;
}
}
});
网友评论