4
[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]
哪个动画 'myPic' 向左与向右翻转。
我需要获得相同的动画,但垂直。从顶部翻转或从底部翻转。我环顾四周,没有人真的有建议的工作模式。
我想这一点,到目前为止,还没有运气:
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]
任何输入? 在此先感谢。
您应该编辑此问题以使用代码的“代码”布局,以便它实际上可读。 – PengOne 2011-02-28 16:12:28
对不起。只是改变了它。 – Gizmodo 2011-02-28 16:14:47
定义“没有运气”。当你运行这段代码时会发生什么? – occulus 2011-02-28 17:19:53