uiview transactions

来源:互联网 发布:mac 远程控制其他电脑 编辑:程序博客网 时间:2024/05/22 05:25
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
                        }];