Cordova应用于IOS设备:如何在键盘上提交按钮文本。

时间:2022-09-25 15:04:45

Actually I'm developing an ios application using Cordova, I want to change the submit button text in device keyboard to "Send" instead of "Return", I already succeeded to change the text to "Search" using the following html code

实际上,我正在开发一个使用Cordova的ios应用程序,我想要将设备键盘上的submit按钮文本改为“Send”而不是“Return”,我已经成功地将文本改为“Search”,使用下面的html代码。

<form>
    <input type="search" name="search-query" id="search-query" />
</form>

Any one can help me please ?

有人可以帮我吗?

1 个解决方案

#1


1  

After about 4 years of "on and off" searching for a solution to this, I do not believe this is possible as the UIWebView will not allow you to set the keyboard submit text via JavaScript or an HTML attribute. So this would require the use of <textInputTraits key="textInputTraits" returnKeyType="Send"/> within a storyboard, or programatically through the view controller which doesn't solve the problem for cordova.

经过大约4年的“反复”寻找解决方案,我认为这是不可能的,因为UIWebView不允许你通过JavaScript或HTML属性设置键盘提交文本。因此,这需要使用 在故事板中,或通过视图控制器编程,这不能解决cordova的问题。

The Ionic Keyboard Plugin for Cordova have also not cracked this fairly popular request since the issue was opened Dec 2014.

自从2014年12月开始,Cordova的Ionic键盘插件也没有破解这一非常流行的请求。

Note: You can add <button type="submit">Whatever</button> below your textfield to at least allow the keyboard to display the blue "Go" button which submits the form.

注意:您可以添加至少允许键盘显示蓝色的"Go"按钮,该按钮提交表单。

#1


1  

After about 4 years of "on and off" searching for a solution to this, I do not believe this is possible as the UIWebView will not allow you to set the keyboard submit text via JavaScript or an HTML attribute. So this would require the use of <textInputTraits key="textInputTraits" returnKeyType="Send"/> within a storyboard, or programatically through the view controller which doesn't solve the problem for cordova.

经过大约4年的“反复”寻找解决方案,我认为这是不可能的,因为UIWebView不允许你通过JavaScript或HTML属性设置键盘提交文本。因此,这需要使用 在故事板中,或通过视图控制器编程,这不能解决cordova的问题。

The Ionic Keyboard Plugin for Cordova have also not cracked this fairly popular request since the issue was opened Dec 2014.

自从2014年12月开始,Cordova的Ionic键盘插件也没有破解这一非常流行的请求。

Note: You can add <button type="submit">Whatever</button> below your textfield to at least allow the keyboard to display the blue "Go" button which submits the form.

注意:您可以添加至少允许键盘显示蓝色的"Go"按钮,该按钮提交表单。