<EditText android:id="@+id/et_PatientID" android:inputType="text" android:layout_width="400dip" android:layout_height="50dip" android:layout_toRightOf="@id/tv_patientID" android:background="@android:drawable/editbox_background" android:imeOptions="actionSearch" android:imeActionLabel="Search" /> 2)注册editext事件editText.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_SEARCH){ performSearch(); return true; } return false; } }); 默认为数字键盘,可以输入文本 设置默认类型为数字 editText.setRawInputType(Configuration.KEYBOARD_QWERTY);