我想要自動一個一個地滑動圖像我正在從圖像路徑從服務器獲取圖像,但它始終只顯示一個圖像我應該怎麼做?圖像不動畫
for (SliderDC *slider in imagesArray) {
sliderImageName = slider.sliderImagePath;
NSData *imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString: [NSString stringWithFormat:@"%@%@",kWSURL, sliderImageName]]];
UIImage *imgOne = [UIImage imageWithData:imageData];
//// likely download all images from web service and create an array like
//
NSArray *imagesArrays = [NSArray arrayWithObjects:imgOne, nil];
//// and use with little modification
//
UIImageView* animatedImageView = [[UIImageView alloc] initWithFrame:self.view.bounds];
animatedImageView.animationImages = imagesArrays;
animatedImageView.animationDuration = 0.5f;
animatedImageView.animationRepeatCount = 0;
[self.view addSubview: animatedImageView];
[animatedImageView startAnimating];
}
我不明白。你只有一個圖像(在'imagesArays'中)。那應該是怎樣的動畫?你讀過如何使用它? – Larme 2014-09-01 08:19:52