与块中的其他 UIViewAnimations 混合
我试图在 iPad 上实现类似 iBook 商店的功能。 当您点击书籍封面时,它会以一种流畅的动作翻转和缩放,从书籍封面到空白背景,然后加载内容。
我尝试了不同的方法,首先翻转,然后缩放,我尝试将 transitionFromView
包装在 animateWithDuration
块内,但我无法让它看起来正确。它要么先做一个,然后再做另一个,或者在最后一种情况下先做一个,然后“flickr”,然后什么都不做。
[UIView transitionFromView:fromView
toView:toView
duration:0.8
options:UIViewAnimationOptionTransitionFlipFromRight
completion:^(BOOL finished) {
if (finished) {
[UIView animateWithDuration:0.4
animations:^{[fromView setFrame:originFrame];}
completion:^(BOOL finished){}];
}
}];
毫无疑问,块非常适合动画! 但我怎样才能同时翻转和缩放呢?
提前致谢。
I was trying to implement something resembling the iBook store on iPad.
When you tap on a book cover it will flip and scale in one fluid motion, from the book cover to an empty background - which then loads the content.
I have tried different approaches, first flipping, then scaling, I tried wrapping the transitionFromView
inside the animateWithDuration
block, but i can't get it to look properly. It will either do one then the other, or in the last case do one, then 'flickr' and do nothing.
[UIView transitionFromView:fromView
toView:toView
duration:0.8
options:UIViewAnimationOptionTransitionFlipFromRight
completion:^(BOOL finished) {
if (finished) {
[UIView animateWithDuration:0.4
animations:^{[fromView setFrame:originFrame];}
completion:^(BOOL finished){}];
}
}];
Blocks are great for animations, no doubt!
But how can I both flip and scale at the same time?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经能够通过对包含您在其之间切换的视图的视图执行翻转,使用非块动画来产生这种效果。
为此,view2 上的自动调整大小蒙版必须可调整宽度和高度的大小。
I have been able to produce this effect using non-block animations by performing the flip on a view containing the views you switch between.
For this to work, the autosizing mask on view2 must be resizable in width and height.