简体   繁体   English

动画UIWebView在动画期间不响应触摸

[英]Animated UIWebView does not respond to touches during animation

At the moment, I'm animating a UIWebView from the bottom of the screen to the top. 目前,我正在将UIWebView从屏幕底部动画到顶部。 As the UIWebView animates upwards it becomes untouchable for 50 - 80 % of the duration time. 作为UIWebView动画向上变得不可触及50 -的持续时间的80%。

If I tap the UIWebviews ending destination, or model layer, the taps are registered and the Webview responds appropriately. 如果我点击UIWebviews结束目的地或模型层,则会注册水龙头并且Webview做出相应的响应。

Why is this? 为什么是这样? And what solutions are there for tapping moving/animating UIWebViews ? 还有什么解决方案可以用于移动/动画UIWebViews

To further exemplify this, I have created a side project that shows a UIWebView animating upwards. 为了进一步举例说明,我创建了一个侧面项目,显示了一个向上动画的UIWebView The purple squares represent touch events on the presentation layer, while the blue squares represent touch events outside of the presentation layer. 紫色方块表示表示层上的触摸事件,而蓝色方块表示表示层之外的触摸事件。

https://github.com/AdamBCo/UIWebView-Animation-Issues https://github.com/AdamBCo/UIWebView-Animation-Issues

As seen in the example, UIViewAnimationOptionAllowUserInteraction is set in the UViewAnimation block. 如示例所示, UIViewAnimationOptionAllowUserInteractionUViewAnimation块中设置。

A UIWebView is complicated layout of web elements. UIWebView是Web元素的复杂布局。 To redraw that during animation there is simply not enough time available to entirely redraw the UIWebView, keep the controls in it available for interaction and do the animation. 要在动画期间重绘它,根本没有足够的时间来完全重绘UIWebView,保持其中的控件可用于交互并执行动画。

However there are some settings for this inside a CALayer on what to do with its contents when animating it. 但是,在CALayer中有一些设置,可以在设置动画时对其内容进行处理。 I would start looking into that. 我会开始研究这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM