UIView animation clips view bounds. Any way to prevent clipping?

我的梦境 提交于 2019-12-13 16:28:30

问题


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):

Animation in flight: (paperclip and rope are clipped)


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/17324717/uiview-animation-clips-view-bounds-any-way-to-prevent-clipping

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!