Scroll i0S11 WKWebView或UIWebView在锚定单击时不滚动

Scroll i0S11 WKWebView或UIWebView在锚定单击时不滚动,scroll,uiwebview,anchor,wkwebview,ios11,Scroll,Uiwebview,Anchor,Wkwebview,Ios11,由于iOS 11,我的网络视图中的“锚”不再工作。 我最初认为是时候从UIWebView迁移到WKWebview了,所以我继续,但这仍然不起作用 我在网上找不到任何回应 有人能帮我吗 提前谢谢 更新: //anchor ? if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"11.0")) { NSArray * spliting = [stringUrl componentsSeparatedByString:@"#"]; if (navi

由于iOS 11,我的网络视图中的“锚”不再工作。 我最初认为是时候从UIWebView迁移到WKWebview了,所以我继续,但这仍然不起作用

我在网上找不到任何回应

有人能帮我吗

提前谢谢

更新:

//anchor ?
if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"11.0"))
{
    NSArray * spliting = [stringUrl componentsSeparatedByString:@"#"];
    if (navigationAction.navigationType == WKNavigationTypeLinkActivated && [spliting count] == 2)
    {
        NSString * anchor = spliting.lastObject;
        //[webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"window.location.hash = '#%@';",anchor]]; // not working in iOS11
        NSString* code = [NSString stringWithFormat:@"el = document.getElementsByName(\"%@\")[0]; if (el) el.scrollIntoView();", anchor];
        (void) [webView evaluateJavaScript:code completionHandler:nil];
    }
}
同-我建议,正如我在那里说的,这只是一个简单的老式错误,你应该向苹果公司提交。同-我建议,正如我在那里说的,这只是一个简单的老式错误,你应该向苹果公司提交。