4

I have created Rich Text Editor using UIWebView . I want to show keyboard without tapping uiwebview , means when i open editor keyboard should be open and uiwebview should be editable.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Sachin Vani
  • 303
  • 3
  • 11
  • Refer to [THIS][1] post on stackoverflow [1]: http://stackoverflow.com/questions/6287478/mobile-safari-autofocus-text-field – iAhmed Oct 10 '13 at 13:56
  • possible duplicate of [UIWebView with contentEditable (html editing), first responder handling?](http://stackoverflow.com/questions/8474386/uiwebview-with-contenteditable-html-editing-first-responder-handling) – memmons Oct 10 '13 at 18:34

1 Answers1

0

Just write this delegate method:

- (void)webViewDidFinishLoad:(UIWebView *)webView {
    webView.keyboardDisplayRequiresUserAction = NO;
    [webView stringByEvaluatingJavaScriptFromString:@"document.getElementById('content').focus()"];

}

content is the element's id.

Scott
  • 162
  • 1
  • 12