1
En essayant d'ajouter une animation à un UIImageView, mais il échoue toujours. Pourquoi? Voici le code:Pourquoi ne puis-je pas ajouter une animation à un 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"];
travail doens't. Ce qui est étrange, c'est que mon code fonctionne avec la couche self.view, mais pas avec la couche animationImage ... – Flocked
Il me manque quelque chose, car UIImageView hérite de UIView, donc vous devriez être capable d'ajouter des animations à sa couche. – glorifiedHacker
@Flocked: chère, essayez 'animationImage.layer' et acceptez cette réponse car elle m'a aidé aussi .. :) – rptwsthi