您好我需要一个简单的代码来创建图像幻灯片。
我目前有以下代码,但不起作用。有人可以告诉我我做错了吗
// Load images
NSArray *imageNames = @[@"image1.jpg", @"image2.jpg", @"image3.jpg", @"image4.jpg",@"image5.jpg"];
for (int i = 0; i < imageNames.count; i++) {
UIImage * toImage = [UIImage imageNamed:[imageNames objectAtIndex:i]];
[UIView transitionWithView:self.view
duration:0.33f
options:UIViewAnimationOptionTransitionCrossDissolve
animations:^{
self->imageview.image = toImage;
} completion:NULL];
}
[imageview startAnimating];