Closed kohdesmond closed 12 years ago
You are copying the image property of the AsyncImageView into another view after setting it to load. That won't work because the image won't have loaded yet so the image will be nil.
Why not just make self.largeImgView into an AsyncImageView and load the image URL directly on that view?
thanks nick,
UIImageView selectorView = [[AsyncImageView alloc] initWithFrame:CGRectMake(0, 105, 250, 250.0f)]; selectorView.contentMode = UIViewContentModeScaleAspectFit; selectorView.backgroundColor = [UIColor clearColor]; [[AsyncImageLoader sharedLoader] cancelLoadingImagesForTarget:selectorView]; ((AsyncImageView )selectorView).imageURL = [self.picsArray objectAtIndex:self.carouselView.currentItemIndex];
//UIImageView *imgView = selectorView;
self.largeImgView=selectorView;
[self.largeImageView addSubview:self.largeImgView];
imageLocation=CGRectMake(selectorView.frame.origin.x, selectorView.frame.origin.y, selectorView.frame.size.width, selectorView.frame.size.height);
self.largeImageView.hidden=YES;
Hi Nick,
will you be able to tell me when had i gone wrong ?
the image is not showing, not event the UIIndicator
(void)imageViewPopup { UIImageView *selectorView = [[AsyncImageView alloc] initWithFrame:CGRectMake(0, 0, 250, 250.0f)]; selectorView.contentMode = UIViewContentModeScaleAspectFit; selectorView.backgroundColor = [UIColor clearColor];
[[AsyncImageLoader sharedLoader] cancelLoadingImagesForTarget:selectorView]; // selectorView.image = [UIImage imageNamed:@"placeholder.png"]; //selectorView.imageURL =[self.picsArray objectAtIndex:self.carouselView.currentItemIndex];
((AsyncImageView *)selectorView).imageURL = [self.picsArray objectAtIndex:self.carouselView.currentItemIndex];
//NSLog(@"[self.picsArray objectAtIndex:self.carouselView.currentItemIndex]; %@",[self.picsArray objectAtIndex:self.carouselView.currentItemIndex]);
UIImageView *imgView = selectorView;
NSLog(@"imgView %@",selectorView);
self.largeImgView=[[UIImageView alloc] initWithImage:[imgView.image copy]]; self.largeImgView.frame=[imgView frame];
[self.largeImgView setUserInteractionEnabled:YES]; }