iPhone卡像翻转动画 [英] iPhone card like flipping animation
问题描述
我试图创建iOS上牌翻转动画,我没有草草收场。
基本上,我有一个控制器的全局视图。里面我有一个holderView,其中包含该卡。
我有卡,这是MAINVIEW的前面,然后将卡的背面,这是一个flipSideView
I'm trying to create a card flipping animation on iOS, and I'm failing miserably.
Basically I have a global View with a Controller. Inside I have a holderView, which contains the card.
I have the front of the card, which is the mainView, and then the back of the card, which is a flipSideView.
我曾尝试做这样的事情:
I have tried doing something like this:
[UIView animateWithDuration:1.0
delay:0
options:UIModalTransitionStyleFlipHorizontal
animations:^{
NSLog(@"started");
[mainView removeFromSuperview];
[holderView addSubview:flipsideView];
} completion:^(BOOL finished){
NSLog(@"completed");
}];
这是不行的,做奇怪的事情,我已经尝试了很多不同的东西,但不能让它正常工作。
有没有人有一个想法,我该怎么办呢?
That doesn't work, does weird things, I have tried a lot of different things but cannot get it to work perfectly. Would anyone have an idea how I can do that ?
感谢您
推荐答案
试试这个:
[UIView transitionFromView:mainView
toView:holderView
duration:1.0f
options:UIViewAnimationOptionTransitionFlipFromRight
completion:^(BOOL finished) {}];
这应该工作。希望帮助!
That should work. Hope that Helps!
这篇关于iPhone卡像翻转动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!