UIView动画剪辑视图范围。有什么办法防止削波吗? [英] UIView animation clips view bounds. Any way to prevent clipping?

查看:83
本文介绍了UIView动画剪辑视图范围。有什么办法防止削波吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个UIView动画,该动画执行垂直翻转动画从一个视图到另一个视图的过渡。问题在于视图具有一些溢出内容(通过在视图上将 clipsToBounds 设置为 NO 来实现)

I have a UIView animation that does a vertical flip animation transition from one view to another. The problem is that the view has some overflowed content (achieved by setting clipsToBounds to NO on the view), and during the animation, the overflowed content gets clipped.

有什么方法可以防止CoreAnimation剪切视图吗?

Is there any way to prevent CoreAnimation from clipping the views?

屏幕截图

普通视图(注意地图顶部的回形针和悬垂的绳索):

飞行中的动画:(回形针和绳索被剪断了)

推荐答案

我建议放置所有视图在透明视图内部旋转(用于地图和剪辑的占位符),然后对其应用动画而不是地图视图。

I'd recommend placing all the views which rotate inside of a transparent view (kind of placeholder for "map" and "clip"), and applying animation to it rather than to your map view.

尝试以其子视图不会溢出的方式设置占位符视图的大小,因此您不必担心会破坏 clipsToBounds

Try to set placeholder view's size the way its subviews won't overflow, so you can not worry about hacking clipsToBounds.

这篇关于UIView动画剪辑视图范围。有什么办法防止削波吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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