UIWebView with contentEditable (html editing), first responder handling?

前端 未结 5 1150
一生所求
一生所求 2020-11-30 07:45

I\'m making an html editor component for an app (using UIWebView with contentEditable in iOS 5.0), and got stuck at how to handle UIWebView first responder status

[w

5条回答
  •  伪装坚强ぢ
    2020-11-30 08:42

    Call the following lines of code when you want to hide the keyboard.

    //wView is your UIWebView
    
    NSString *webText = [wView stringByEvaluatingJavaScriptFromString:@"document.body.innerHTML"];
     [wView loadHTMLString:webText baseURL:nil];
    

提交回复
热议问题