iOS 卷起动画去除uiimageview
我正在寻找使用卷曲动画从我的应用程序中删除图像。我已经得到了
[UIView transitionWithView:sender.view.superview duration:1.5
options:UIViewAnimationOptionTransitionCurlUp
animations:^ { [sender.view removeFromSuperview]; }
completion:nil];
,但这会将整个页面卷曲起来,看起来好像下面有一个单独的页面,上面没有图像。
是否可以将图像卷出页面而不影响页面的其余部分,而不是“过渡”到新页面?我是否需要将图像视图包装在“容器视图”中并更改视图的过渡?
i'm looking to remove an image from my app with a curl up animation. I've got
[UIView transitionWithView:sender.view.superview duration:1.5
options:UIViewAnimationOptionTransitionCurlUp
animations:^ { [sender.view removeFromSuperview]; }
completion:nil];
but this curls the entire page away and looks as though there's a separate page beneath without the image on it.
Instead of a 'transition' to a new page is it possible to curl the image off the page without affecting the rest of the page? Do I need to wrap the imageview in a 'container view' and change transition with view to that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的视图参数是
sender.view.superview
这意味着您希望超级视图具有动画效果。只需删除超级视图部分即可。编辑:此外,对于要制作动画的东西,它必须是可制作动画的属性。从超级视图中删除视图与其属性无关。您可以将视图动画设置为 0 alpha,并在动画完成后将其从超级视图中删除,如下所示:
Your view parameter is
sender.view.superview
which means you want the superview to animate. Just remove the superview part.Edit: also, for something to animate, it must be animatable property. Removing a view from superview has nothing to do with it's properties. You could animate the view to 0 alpha and on completion of that animation remove it from superview like this: