使用Trigger.IO/PhoneGap在UIWebView中使用focus()事件自动显示键盘 [英] Show keyboard automatically with focus() event in UIWebView using Trigger.IO/PhoneGap

查看:225
本文介绍了使用Trigger.IO/PhoneGap在UIWebView中使用focus()事件自动显示键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设这是不可能的,因为iOS 6,你可以设置UIWebView的keyboardDisplayRequiresUserAction = NO。

Supposedly, this has not been possible since iOS 6 where you can set the UIWebView's keyboardDisplayRequiresUserAction = NO.

我使用的是html 5的webview )和构建一个本地插件,但是我很难抓住UIWebView实例。

I'm using a html 5 webview (Trigger.IO) and building a native plugin but am having difficulty grabbing hold of the UIWebView instance.

如何抓住webview,所以我只需要做以下事情:

How do I grab hold of the webview so I can simply do the following:

mywebview.keyboardDisplayRequiresUserAction = NO;

可能真的很简单..我失踪了什么?

Probably really simple.. what am I missing?

推荐答案

访问UIWebView不是我们在当前版本的插件中正确暴露的(但我们很快就会支持的)。现在如果你想尝试它,你可以添加

Access to the UIWebView isn't something we properly expose in the current version of plugins (but is something we will support soon). For now if you want to try it out you can add

extern UIWebView *webView;

到您的插件文件的顶部,这将使您的API方法中提供变量webView。

to the top of your plugin file, which will make the variable webView available in your API methods. This will stop working very soon though so I recommend you only use this to test things out for now.

2012年10月更新

应用程序的Web视图现在通过 ForgeApp http://docs.trigger.io/en/v1.4/_static/ native / ios / Classes / ForgeApp.html#// api / name / webView

The app's web view is now exposed via ForgeApp: http://docs.trigger.io/en/v1.4/_static/native/ios/Classes/ForgeApp.html#//api/name/webView

例如:

[ForgeApp sharedApp].webView

这篇关于使用Trigger.IO/PhoneGap在UIWebView中使用focus()事件自动显示键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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