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