How to set a custom keyboard for UIWebView

How to show a custom keyboard and Input Accessory View for a editable UIWebView for iOS7 and up.

ie: How can i set and make use a value from [UIWebView setInputView:] and [UIWebView setInputAccessoryView:]


It would be helpful to understand what you're trying to do? You can either be trying to force a specific type of keyboard such as numeric, email, etc. that will use the keyboard the user has explicitly installed on their device (or the system one).

In order to do this, you can reference this apple doc which shows you the 'type' attribute to add to an tag.

Otherwise you are asking about loading a custom keyboard that you have created from the webview. The app developer in me screams, "you should NEVER do this." If you're content is generic enough to merit putting into a webview, than it is certainly not worth loading a custom keyboard.

If you realllly need to do this, you can set keyboardDisplayRequiresUserAction to NO, then use custom javascript to request the app to perform a native function, then drop a uitextfield or uitextview directly overtop the html input field and set a custom input view on the native control. There are an obscene amount of problems with following this approach, and I sincerely hope you


Are you trying to customize the ios keyboard or you want to show an HTML keyboard?

In the first case you can look at this link: link

In the second case you can just google for it, this is the first result searching for "html keyboard".

Good luck


I believe there is no way to do this as of now. Hence, my current approach is to use a custom view below the keyboard and hide the keyboard and show the keyboard as required.

链接地址: http://www.djcxy.com/p/82456.html

上一篇: 何时更新PHPdoc中的标签@author?

下一篇: 如何为UIWebView设置自定义键盘