setKeyboardAppearance for UIWebView

那年仲夏 提交于 2019-12-02 08:12:33

问题


It is well know that the keyboard appearance of UITextView and UITextField can be set as following :

[self.textField setKeyboardAppearance:UIKeyboardAppearanceAlert];

But how could we set the keyboard appearance of a UIWebView?

Actually, here im using ckeditor for HMTL editing.


回答1:


Unfortunately, you can not set the keyboard appearance for a UIWebView using Apple's UIKit APIs.

You can however specify the input type using html tags like so:

<input type="text" size="30" autocorrect="off" autocapitalization="on">

And here are the other parameters.

Text: <input type="text"></input>
Telephone: <input type="tel"></input>
URL: <input type="url"></input>
Email: <input type="email"></input>
Zip code: <input type="text" pattern="[0-9]*"></input>

More info in the Apple docs:

Text, Web, and Editing Programming Guide for iOS




回答2:


I dont think you can set it for a UIWebview. UITextView and UITextField can become first responder but a UIWebView can not be first responder. So there are no property called keyboardAppearance for UIWebview. Its just that its elements inside UIWebview can bring keyboard to show up and not the UIWebview.




回答3:


using any web page to load web view in xcode,it have default keyboard,thh key board contains done, next&previous buttons,next&previous used to move textfields



来源:https://stackoverflow.com/questions/13132446/setkeyboardappearance-for-uiwebview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!