限制Android的EditText输入文字时换行


EditText editText = (EditText) findViewById(R.id.text_editor);
        editText.setOnEditorActionListener(new OnEditorActionListener() {           
            @Override
            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {               
                return (event.getKeyCode() == KeyEvent.KEYCODE_ENTER); 搜索
            }
    });

你可能感兴趣的:(Android)