美文网首页DevSupport
iOS中 遇到的关于Webview加载H5的问题

iOS中 遇到的关于Webview加载H5的问题

作者: o本是后山人o偶作前堂客o | 来源:发表于2017-07-24 14:22 被阅读409次

    项目中用Webview加载H5页面,遇到的一个问题.

    WebKit discarded an uncaught exception in the webView:willRemoveScrollingLayer:withContentsLayer:forNode: delegate:-[WebActionDisablingCALayerDelegate willBeRemoved]: unrecognized selector sent to instance 0x61800001a5e0

    去网上,总结大家的反馈,有这些情况导致了:

    ********[WebActionDisablingCALayerDelegate willBeRemoved]异常    原因是touch和鼠标事件冲突。

    ******** This is happening when I change some constraints on myUIWebViewand then call:

    self.webViewWidthConstraints.constant=newWidth;

    [self.webView setNeedsLayout];

    [self.webView layoutIfNeeded];

    链接

    ********Not sure if this is your case, but I also started seeing this problem on iOS 8 and we tracked it down to the usage of the following CSS property on an iframe:

    -webkit-overflow-scrolling: touch;

    After we removed it, we no longer had those error messages.

    Note: in my case, it didn't happen in response to changing any constraints, but rather it happened while we were navigating through the HTML.

    ********Not sure if this is your case, but I also started seeing this problem on iOS 8 and we tracked it down to the usage of the following CSS property on an iframe:

    ********I found that by adding "-webkit-transform: translateZ(0px);" to the scrollable content (I have a div inside my scrollable container), it fixed the issue for me. Hope this helps.

    解决方案:

    ********为 WebActionDisablingCALayerDelegate 这个私有类添加方法,在后面的一次提交审核过程中,ipa文件提交失败:引用私有API(还是私有类,记不得了)。所以建议不要采用。链接

    ********使用WKWebview代替UIWebview

    相关文章

      网友评论

      本文标题:iOS中 遇到的关于Webview加载H5的问题

      本文链接:https://www.haomeiwen.com/subject/fhtbkxtx.html