1

我试图向 UIImageView 添加动画,但它总是失败。为什么?这是代码:

        //(…)
        UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();    
        animationImage = [[UIImageView alloc]initWithImage:newImage];
        [self.view addSubview:animationImage];

        CATransition *animation = [CATransition animation];
        [animation setDelegate:self];
        [animation setDuration:0.35];
        [animation setTimingFunction:UIViewAnimationCurveEaseInOut];
        animation.type = @"pageCurl";
        animation.fillMode = kCAFillModeForwards;
        animation.endProgress = 0.58;
        [animation setRemovedOnCompletion:NO];
        [[animationImage layer] addAnimation:animation forKey:@"pageCurlAnimation"];
4

1 回答 1

2

尝试使用:

[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];

而不是:

[animation setTimingFunction:UIViewAnimationCurveEaseInOut];
于 2010-03-31T05:06:19.757 回答