0
배열에서 iCarousel보기로 이미지를로드하려고합니다. 그러나 이미지는이 코드 짓을 .. 표시되지 않습니다 =를iCarousel 이미지가 표시되지 않습니다.
- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSInteger)index reusingView:(UIView *)view {
UILabel *label = nil;
UIImageView *eventImg = nil;
const NSInteger LblTag = 1;
const NSInteger ImgTag = 2;
NSLog(@"THIS INDEX %ld",(long)index);
NSLog(@"Flyer AT thisss INDEX=====%@",[[arrAllEvents objectAtIndex:index] valueForKey:@"flyer_image"]);
if (view == nil) {
eventImg = [[UIImageView alloc] initWithFrame:CGRectMake(_barEventsListView.frame.origin.x, _barEventsListView.frame.origin.y, _barEventsListView.frame.size.width - 70, _barEventsListView.frame.size.height - 40)];
eventImg.tag = ImgTag;
view.contentMode = UIViewContentModeScaleToFill;
label = [[UILabel alloc] initWithFrame:view.bounds];
label.backgroundColor = [UIColor clearColor];
label.textAlignment = NSTextAlignmentCenter;
label.font = [label.font fontWithSize:50];
label.tag = LblTag;
[view addSubview:label];
[view addSubview:eventImg];
}
else {
label = (UILabel *)[view viewWithTag:1];
eventImg = (UIImageView *)[view viewWithTag:2];
}
[eventImg sd_setImageWithURL:[NSURL URLWithString:[[arrAllEvents valueForKey:@"flyer_image"] objectAtIndex:index]] placeholderImage:[UIImage imageNamed:@"user_upload"] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
}];
return view;
}
사람이 내가 잘못 여기서 뭐하는 거지 도와 드릴까요
이 메서드에서 반환되는보기의 문제. 해당 값을 nil에 할당해야합니다. –
@ Mother 감사합니다! – Niharika