I have a UITabViewController set up with two tabs, the second containing a web browser. The keyboard will not appear in my App unless I first display and dismis
The solution mentioned here didn't work for me. I had a persistent error that seemed to be an issue with iOS, or at least my build settings. I came up with a workaround. If you're still stuck like I was, try this. I think it will work. Here it is briefly. Check out my post if you need more detail.
Put this into your web view's delegate:
- (BOOL)webView:(UIWebView *)v shouldStartLoadWithRequest:(NSURLRequest *)r navigationType:(UIWebViewNavigationType)t {
NSString *requestString = [[r URL] absoluteString];
if ([requestString hasPrefix: @"yourURLPrefix:"] ) {
if ([requestString hasPrefix: @"yourURLPrefix:keyboardFix"] ) {
[v.window makeKeyAndVisible];
}
}
Put this into the onFocus event handler of any input element you need to reliably bring up the keyboard:
document.location = "yourURLPrefix:keyboardFix";