开发者

Why can I not add a animation to a UIImageView?

Im trying to add a animation to a UIImageView, but it always fails. Why? Here is the code:

        //(…)
        UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();    
        animationImage = [[UIImageView alloc]initWithImage:newImage];
        [self.view addSubview:animationImag开发者_如何学Ce];

        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"];


Try using:

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

insteaad of:

[animation setTimingFunction:UIViewAnimationCurveEaseInOut];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜