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

项目中用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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 13,580评论 0 23
  • 晚上,明明已经很困了,却总是不愿睡去,早上明明已经醒来,却也还是赖着不愿起床,貌似要成为一个自己打不破的坏习惯了,...
    YQ筑梦阅读 2,312评论 4 2
  • 麒麟猫咪主题餐厅咖啡馆无论是不是猫咪控都受不了喵星人的软萌样,猫咪咖啡店很多,但像这样可以摸爬滚打喂,甚至可以带回...
    52voiceover阅读 4,751评论 0 1
  • 前段时间回家,家里忙完挺晚了,晚饭后看着电视,不自然的听到了《明日之子》里一首很触动内心的歌,叫《消愁》,...
    青海李云云阅读 3,764评论 0 0

友情链接更多精彩内容