Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show keyboard automatically with focus() event in UIWebView using Trigger.IO/PhoneGap

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

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

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?

like image 746
Karoh Avatar asked Jan 29 '26 01:01

Karoh


1 Answers

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;

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.

Update Oct 2012:

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

E.g.:

[ForgeApp sharedApp].webView
like image 146
Connorhd Avatar answered Jan 31 '26 02:01

Connorhd



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!