1
你好,我使用EGOImageView惰性图像加载。我在UITable视图上使用相同的代码。 首先我正在配置的单元格,然后配合使用tableviewCellWithReuseIdentifier返回cell.I正在使用的代码:如何添加懒惰的图像加载到UIimageview
这是我tableviewCellWithReuseIdentifier我在哪里用标签定义的UIImageView:
- (UITableViewCell *)tableviewCellWithReuseIdentifier:(NSString *)identifier
{
if([identifier isEqualToString:@"UICell"])
{
UITableViewCell *uiCell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:identifier] autorelease];
uiCell.textLabel.textAlignment = UITextAlignmentCenter;
uiCell.textLabel.font = [UIFont systemFontOfSize:16];
return uiCell;
}
CGRect rect;
rect = CGRectMake(0.0, 0.0, 320.0, 70.0);
UITableViewCell *cell = [[[UITableViewCell alloc] initWithFrame:rect reuseIdentifier:identifier] autorelease];
// [cell setAccessoryType:UITableViewCellAccessoryDetailDisclosureButton];
cell.selectionStyle =UITableViewCellSelectionStyleNone;
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 70.0)];
imageView.tag = BG_Image;
[cell.contentView addSubview:imageView];
[imageView release];
return cell;
}
,这我在哪里构成单元的功能:
-(void)configureCell:(UITableViewCell *)cell forIndexPath:(NSIndexPath *)indexPath
{
UIImageView *imageView = (UIImageView *)[cell viewWithTag:BG_Image];
imageView.image = [UIImage imageNamed:@"event_box_bg.png"];
}
,这是我的自我形象代码初始化后,我想知道如何使用这个代码,并在那里
EGOImageView *_eventImageView = [[EGOImageView alloc] initWithPlaceholderImage:[UIImage imageNamed:@"placeholder.png"]];
请帮助..
Tha NKS,
感谢它为我工作... – gaurav