滚动广告效果
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;