UIWebView抛出[WebActionDisablingCALayerDelegate setBeingRemoved:]的异常 [英] UIWebView throwing exception for [WebActionDisablingCALayerDelegate setBeingRemoved:]

查看:796
本文介绍了UIWebView抛出[WebActionDisablingCALayerDelegate setBeingRemoved:]的异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当针对iOS 8运行时,我开始看到来自 UIWebView 的深层内容的以下异常:

When running against iOS 8, I began to see the following exception coming from the deep bowels of UIWebView:

[WebActionDisablingCALayerDelegate setBeingRemoved:]:无法识别的选择器发送到实例0x167ee900

[WebActionDisablingCALayerDelegate setBeingRemoved:]: unrecognized selector sent to instance 0x167ee900

* WebKit丢弃了未捕获的异常webView:willRemoveScrollingLayer:withContentsLayer:forNode:delegate: - [WebActionDisablingCALayerDelegate setBeingRemoved:

* WebKit discarded an uncaught exception in the webView:willRemoveScrollingLayer:withContentsLayer:forNode: delegate: -[WebActionDisablingCALayerDelegate setBeingRemoved:

当我改变对我的一些约束时会发生这种情况code> UIWebView 然后调用:

This is happening when I change some constraints on my UIWebView and then call:

 self.webViewWidthConstraints.constant = newWidth;
 [self.webView setNeedsLayout];
 [self.webView layoutIfNeeded];

(这样可以重新渲染webview的内容以正确调整其宽度)。

(This is so that the webview's content is re-rendered to fit its width correctly).

幸运的是,异常被丢弃,因此应用程序不会崩溃。为什么会发生这种情况,有没有办法阻止它?

Luckily the exception is discarded, so the app isn't crashing. Why is this happening, and is there any way to prevent it?

推荐答案

我发现通过添加-webkit-transform: translateZ(0像素);对于可滚动的内容(我的可滚动容器中有一个div),它为我解决了问题。希望这会有所帮助。

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.

这篇关于UIWebView抛出[WebActionDisablingCALayerDelegate setBeingRemoved:]的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆