我正在尝试实现一个按钮,当点击时不会移动到下一个编辑文本。下面是我的代码:
<EditText
android:id="@+id/address_edittext"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:hint="@string/address_textview_hint"
android:imeActionLabel="@string/search_button"
android:imeOptions="actionNone"
android:inputType="textCapWords"
android:singleLine="true" />当我点击这个按钮时,一些操作是由代码完成的,但是错误地跳转到其他编辑文本。
我该怎么解决这个问题呢?
发布于 2013-09-25 04:40:17
在这里使用TextView.OnEditorActionListener是LINK
查看此example
editText = (EditText) findViewById(R.id.emai_text);
editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_NEXT) {
// your action...........
}
return false;
}
});发布于 2017-01-18 15:32:21
您只需要在textCapWords之外添加textMultiLine
<EditText
android:id="@+id/editText_itemDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textMultiLine|textCapWords"
/>https://stackoverflow.com/questions/18991395
复制相似问题