设置Android键盘上的回车键 [英] Setting the Return key on the Android keyboard

查看:791
本文介绍了设置Android键盘上的回车键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

难道有人对你友好codeRS知道如何改变Android键盘的回车键文本。我抓住一个EditText元素的回归事件来启动操作。所以,我想向用户显示,他就可以开始使用该密钥的操作。有些应用程序做到这一点。例如。他们更换一个搜索符号的关键。

Does anyone of you friendly coders know how to change the text on the return key of the android keyboard. I am catching the return event of an EditText element to start an action. So I would like to show the user, that he can start the action with that key. Some applications do that. E.g. they replace the key with a search symbol.

我也想知道为什么总是应用程序有一个额外的按钮预留了文本字段。显然,这拿走的屏幕空间。但它可能对某些目的而需要的,我不知道了。有一个问题我能想象的任务切换。切换回后,用户将必须调用键盘之前,他可以启动的动作。另一种是硬件键盘,但没有人会认为返回键将开始行动。

I am also wondering why apps always have an additional button aside the text field. Clearly, this takes away screen space. But it may be necessary for some purpose I am not aware off. The one problem I could imagine is task switching. After switching back, the user would have to call the keyboard before he could start the action. The other is a hardware keyboard, but anyone will assume that the return key will start the action.

R.G。

推荐答案

有一些方法来改变你的软件键盘上的返回按钮的行为。如果你想有你的键盘上的搜索图标,你必须添加的android:imeOptions =actionSearch您的EditText视图。有迹象表明,你可以超过可用选项的概述设置一些其他行动来看看的<一个文档href=\"http://developer.android.com/reference/android/widget/TextView.html#attr_android%3aimeOptions\">TextView.

There are some ways to change the behaviour of the return button on your software keyboard. If you want to have the search Icon on your keyboard you have to add android:imeOptions="actionSearch" to your EditText View. There are some other actions that you can set for an overview over the available options have a look at the documentation of the TextView.

我猜想,旁边还有许多文本框按钮来触发动作是因为用户习惯了,并将在损失一点点,如果按钮丢失尤其是用户与硬件键盘或软件的原因键盘消失。另外一个问题是,返回键也被用来创建换行,这意味着如果你想有一个多行文本字段,您不能使用返回键启动操作。

I would guess the reason that there are buttons next to many textfields to trigger the action is because users are used to it and would be a little bit at loss if the button is missing especially users with a hardware keyboard or if the software keyboard disappeared. One additional problem is that the return key is also used to create line breaks this means that if you want to have a multi line text field you cant use the return key to start an action.

这篇关于设置Android键盘上的回车键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆