以编程方式在 UIWebView 中显示键盘 [英] Programmatically display keyboard in UIWebView

查看:26
本文介绍了以编程方式在 UIWebView 中显示键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果 UIWebView 中的元素具有样式属性 -webkit-user-modify:read-write,则按下该元素会导致键盘出现.是否可以以编程方式调出键盘?

If an element in a UIWebView has the style property -webkit-user-modify:read-write, then pressing on the element causes the keyboard to appear. Is it possible to bring up the keyboard programatically?

谢谢

推荐答案

看起来现在在 iOS6 中你可以使用keyboardDisplayRequiresUserAction"来做到这一点:

It looks like in iOS6 now you can do this with "keyboardDisplayRequiresUserAction":

keyboardDisplayRequiresUserAction一个布尔值,指示网页内容是否可以以编程方式显示键盘.

keyboardDisplayRequiresUserAction A Boolean value indicating whether web content can programmatically display the keyboard.

@property (nonatomic) BOOL keyboardDisplayRequiresUserAction讨论当此属性设置为 YES 时,用户必须明确点击 Web 视图中的元素以显示该元素的键盘(或其他相关输入视图).当设置为 NO 时,元素上的焦点事件会导致显示输入视图并自动与该元素关联.

@property (nonatomic) BOOL keyboardDisplayRequiresUserAction Discussion When this property is set to YES, the user must explicitly tap the elements in the web view to display the keyboard (or other relevant input view) for that element. When set to NO, a focus event on an element causes the input view to be displayed and associated with that element automatically.

此属性的默认值为 YES.

The default value for this property is YES.

可用性在 iOS 6.0 及更高版本中可用.申报在UIWebView.h

Availability Available in iOS 6.0 and later. Declared In UIWebView.h

参考:

这篇关于以编程方式在 UIWebView 中显示键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆