How to change keyboard button “Return” to “Search”

2020-07-22 16:54发布

I have this simple HTML file that is to be displayed in a UIWebView.

<html>
<body>
  <p>
  <input name='search' type='search' placeholder="Input type is search" />
</body>
</html>

Here is the screenshot when I clicked the input box.

enter image description here

How to change the Return button to 'Search' like Google page does?

enter image description here

3条回答
在下西门庆
2楼-- · 2020-07-22 17:14

I found a simple solution. Just wrap the input with form tag so the HTML looks like this.

<html>
<body>
  <p>
  <form>
    <input name='search' type='search' placeholder="Input type is search" />
  </form>
</body>
</html>

And now the keyboard looks like

enter image description here

查看更多
Explosion°爆炸
3楼-- · 2020-07-22 17:23

You have to select the textfield & in identity inspector you select search shown in pic below :

查看更多
做自己的国王
4楼-- · 2020-07-22 17:33

Looking in the reference: Text Programming Guide for iOS and I can see that the type search isn't an option, so I think that Safari handle that with a different way. Maybe with a custom inputview. Take a look in my answer to do that.

查看更多
登录 后发表回答