【发布时间】:2014-08-31 04:32:34
【问题描述】:
我尝试了 100 多种方法来使用 SDWebImage 为图像设置动画,但总是失败。我是否理解使用积木的好处?我有 IBOutlet 属性图像名称 images1。我制作了数组来存储值并为 3 张图像设置动画。
NSMutableArray *imagegallery = [[NSMutableArray alloc] init];
NSLog(@"IMAGES-%@", imagegallery);
[self.images1 setImageWithURL:[NSURL URLWithString:[self.objc objectForKey:@"Img1"]]
placeholderImage:[UIImage imageNamed:@"placeholder.png"]
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType) {
[imagegallery addObject:image];
NSLog(@"Ima1-------%@", image);
}];
[self.images1 setImageWithURL:[NSURL URLWithString:[self.objc objectForKey:@"Img2"]]
placeholderImage:[UIImage imageNamed:@"placeholder.png"]
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType) {
[imagegallery addObject:image];
}];
[self.images1 setImageWithURL:[NSURL URLWithString:[self.objc objectForKey:@"Img3"]]
placeholderImage:[UIImage imageNamed:@"placeholder.png"]
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType) {
[imagegallery addObject:image];
}];
self.images1.animationImages = imagegallery; //this line gets error
self.images1.animationDuration = 0.5;
[self.view addSubview:self.images1];
[self.images1 startAnimating];
【问题讨论】:
-
你得到什么错误?
-
-[__NSCFConstantString _isResizable]:无法识别的选择器发送到实例 0x2fce30(lldb)
标签: ios animation uiimageview nsarray sdwebimage