简体   繁体   English

显示转到按钮,而不是在android软键盘的textarea中返回

[英]Display go button instead of return in textarea for android soft keyboard

I'm developing a mobile web application that contains a form with a textarea. 我正在开发一个移动Web应用程序,其中包含带有textarea的表单。 Android, with the textarea on focus displays a Return button instead of Go button. 重点关注textarea的Android显示“返回”按钮而不是“执行”按钮。

Is it possible to force the android soft keyboard to display a Go button instead of Return? 是否可以强制Android软键盘显示“转到”按钮而不是“返回”?

NOTE: it's a web application hence HTML not java 注意:这是一个Web应用程序,因此HTML不是Java

Please add following two lines to your edittext: 请在编辑文本中添加以下两行:

<EditText
    android:singleLine="true"
    android:imeOptions="actionGo"/>

This will enable Go button on your softkeyboard 这将在软键盘上启用“转到”按钮

And to listen Go button Add 并听Go按钮添加

editText.setOnEditorActionListener(){
@override
public boolean onEditorAction (TextView v, int actionId, KeyEvent event) {
    if(actionId=EditorInfo.IME_ACTION_GO){
        //perfrom your action
    }
    return false;
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM