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];
精彩评论