滚动广告效果

    CATransition *animation = [[CATransition alloc]init];
    animation.type = kCATransitionFromTop;
    animation.subtype = kCATransitionFromTop; //向上滚动,其他方向自己设置
    animation.duration = 0.3;
    [self.imageView.layer addAnimation:animation forKey:nil];
    NSString *imageName = [NSString stringWithFormat:@"ad%ld.jpg",++currentIndex % 5 + 1];
    UIImage *image = [UIImage imageNamed:imageName];
    self.imageView.image = image;

 

posted @ 2015-07-25 17:40  Emyin  阅读(141)  评论(0编辑  收藏  举报