UIWebView获取光标,或者通过代码获取光标

1: 设置keyboardDisplayRequiresUserAction属性为NO

_webView.keyboardDisplayRequiresUserAction = NO;

2:可编辑对象id假设是content

- (void)webViewDidFinishLoad:(UIWebView *)webView {
  
    //默认获取光标
    [self.webView stringByEvaluatingJavaScriptFromString:@"document.getElementById('content').focus()"];
}

你可能感兴趣的:(UIWebView获取光标,或者通过代码获取光标)