UIView animation clips view bounds. Any way to pre

2019-07-20 16:28发布

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.

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

Screenshots

Normal view (notice the paperclip and overhanging rope along the top edge of the map):

Normal

Animation in flight: (paperclip and rope are clipped)

Animating

2条回答
forever°为你锁心
2楼-- · 2019-07-20 16:47

have you tried: myView.layer.masksToBounds = NO; ?

查看更多
放荡不羁爱自由
3楼-- · 2019-07-20 16:53

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.

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

查看更多
登录 后发表回答