Given:
[UIView beginAnimations:nil context:nil]; [UIView setAnimationCurve:UIViewAnimationCurveEaseOut]; [UIView setAnimationDuration:.5]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:card cache:NO]; myPic = [UIImage UIImagenamed: @"mySecondImage.png"]; [UIView commitAnimations];[/CODE]
What is the animation "myPic" from right to left with flip.
I need to get the same animation, but vertically. Flip over or flip below. I looked around, someone did not have a working model.
I tried this but no luck:
float duration = .5; CABasicAnimation* animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.x"]; animation.fromValue = [NSNumber numberWithDouble:0.0f * M_PI]; animation.toValue = [NSNumber numberWithDouble:1.0f * M_PI]; animation.duration = duration; animation.removedOnCompletion = NO; animation.fillMode = kCAFillModeBoth; animation.repeatCount =1;; animation.beginTime = CACurrentMediaTime(); animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; card.layer.anchorPoint = CGPointMake(0.5, 1.0); [card.layer addAnimation:animation forKey:@"rotationX"];[/CODE]
Any input? Thanks in advance.
iphone animation flip
Gizmodo Feb 28 '11 at 16:10 2011-02-28 16:10
source share