CATransition *animation = [CATransition animation];
animation.duration = 0.5;
animation.type = kCATransitionMoveIn;
animation.subtype = kCATransitionFromRight;
[myImageView.layer addAnimation:animation forKey:@"imageTransition"];
myImageView.image = newImage;
/////1
// [UIView
// animateWithDuration:duration
// delay:delay
// options:(UIViewAnimationCurve)opt
// animations:^{
// self.image47.alpha = 0;
// self.imageView472.alpha = 1;
// }
// completion:^(BOOL finished){
// self.image47.hidden = YES;
// }
// ];
////2
[UIView transitionFromView:self.image47
toView:self.imageView472
duration:duration
options:UIViewAnimationOptionTransitionCrossDissolve
completion:^(BOOL finished) {
// animation completed
}];
本文介绍了使用Core Animation实现视图动画与过渡效果的方法,包括CATransition类的应用及UIView动画属性的配置。
7946

被折叠的 条评论
为什么被折叠?



