简体   繁体   中英

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. As the UIWebView animates upwards it becomes untouchable for 50 - 80 % of the duration time.

If I tap the UIWebviews ending destination, or model layer, the taps are registered and the Webview responds appropriately.

Why is this? And what solutions are there for tapping moving/animating UIWebViews ?

To further exemplify this, I have created a side project that shows a UIWebView animating upwards. 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

As seen in the example, UIViewAnimationOptionAllowUserInteraction is set in the UViewAnimation block.

A UIWebView is complicated layout of web elements. 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.

However there are some settings for this inside a CALayer on what to do with its contents when animating it. I would start looking into that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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