【问题标题】:Changing the keyboard return key in WKWebView更改 WKWebView 中的键盘返回键
【发布时间】:2016-11-17 00:02:19
【问题描述】:

我在 WkWebView 中显示了以下页面

<html>
  <textarea name='message' placeholder='Type your message here'/>
</html>

在此字段中输入文本时,键盘会显示一个正常的“返回”键。

我想将此字段的返回键标签更改为“发送”。

在 WKWebView 中可以吗?

我知道这个答案:How to change keyboard button "Return" to "Search" for input in a UIWebView? 但建议的解决方案仅适用于 UIWebView。

【问题讨论】:

    标签: ios swift wkwebview


    【解决方案1】:

    对于仍在寻找答案的人,我们现在有 html enterkeyhint 属性:MDN

    <input id="send" enterkeyhint="send" />
    
    <!— or —>
    
    <textarea enterkeyhint="send"></textarea>
    
    

    大多数enterkeyhint 值(enter/done/go/next/previous/search/send)都有它们的 iOS UIReturnKeyType 对应项,并且返回键更改为相应的外观。

    【讨论】:

      猜你喜欢
      • 2018-03-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多