ios界面跳转动画

界面跳转动画:
ViewController的属性:
//设置跳转动画的类型

myVC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;

添加转场动画:

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    self.imageIndex++;
    if (self.imageIndex > 43) return;
    
    NSString *imageName = [NSString stringWithFormat:@"a%ld",self.imageIndex];
    
//    添加转场动画
    [UIView transitionWithView:self.imageView duration:0.01 options:UIViewAnimationOptionTransitionCurlUp animations:^{
        self.imageView.image = [UIImage imageNamed:imageName];
    } completion:nil];
}
posted @ 2017-08-23 21:17  笑笑就好90  阅读(136)  评论(0编辑  收藏  举报