Android的软键盘操作按钮按钮、键盘操作、Android

2023-09-05 10:00:38 作者:Naughty Girl淘气女孩

我的布局具有4的EditText的意见和提交按钮来查看。我需要有下一步按钮,第3的EditText的和地方的软键盘的新线键完成的第4场的EditText按钮。

My layout has 4 EditText views and a submit Button view. I need to have "Next" button for the first 3 EditText's and a "Done" button for 4th EditText field in place of a "New Line" key of soft keyboard.

如何才能做到这一点?

推荐答案

在你的布局,只需设置XML属性安卓imeOptions =actionNext为您前三文本框和机器人:imeOptions =actionDone最后一个

In your layout, just set the XML attributes android:imeOptions="actionNext" for your first three text boxes and android:imeOptions="actionDone" for the last one.

请参阅:android:imeOptions文档

此外,还有在培训文档一个小的XML的例子。

Also, there's a small XML example in the training docs.