Ios UIWebview可编辑内容滚动和滚动指示器问题?

Ios UIWebview可编辑内容滚动和滚动指示器问题?,ios,uiwebview,uiscrollview,Ios,Uiwebview,Uiscrollview,我使用基于设备大小的uiwebview加载html文件分页。所以我在webview的didfish中使用了下面的脚本。它根据设备大小分页 NSString *varMySheet = @"var mySheet = document.styleSheets[0];"; NSString *addCSSRule = @"function addCSSRule(selector, newRule) {" "if (mySheet.addRule) {" "mySheet.addRule(sele

我使用基于设备大小的uiwebview加载html文件分页。所以我在webview的didfish中使用了下面的脚本。它根据设备大小分页

NSString *varMySheet = @"var mySheet = document.styleSheets[0];";

NSString *addCSSRule =  @"function addCSSRule(selector, newRule) {"
"if (mySheet.addRule) {"
"mySheet.addRule(selector, newRule);"                               // For Internet Explorer
"} else {"
"ruleIndex = mySheet.cssRules.length;"
"mySheet.insertRule(selector + '{' + newRule + ';}', ruleIndex);"   // For Firefox, Chrome, etc.
"}"
"}";

NSString *insertRule1 = [NSString stringWithFormat:@"addCSSRule('html', 'height: %fpx; -webkit-column-gap: 0px; -webkit-column-width: %fpx;')", webView.bounds.size.height, webView.bounds.size.width];
NSString *insertRule2 = [NSString stringWithFormat:@"addCSSRule('p', 'text-align: left;')"];
NSString *setTextSizeRule = [NSString stringWithFormat:@"addCSSRule('body', '-webkit-text-size-adjust: %d%%;')", currentTextSize];

[webviewone stringByEvaluatingJavaScriptFromString:varMySheet];

[webviewone stringByEvaluatingJavaScriptFromString:addCSSRule];

[webviewone stringByEvaluatingJavaScriptFromString:insertRule1];

[webviewone stringByEvaluatingJavaScriptFromString:insertRule2];
上面的脚本为html文件“n”页分页

它显示了n个数字中的第一页

加载的html文件添加为“可编辑为真”

<body contenteditable='true'>

我的问题是:

  • 当我要在webview中选择文本时,它将跳转到其他页面

  • 在webview中,滚动指示器不显示完整的webview框架