Hello i am using the EGOImageView for lazy image loading.I m using the same code on UITable view.
Firstly i am configuring the cell and then with the use of tableviewCellWithReuseIdentifier returning the cell.I am using the code:
This is my tableviewCellWithReuseIdentifier where i am defining the UIImageView with tag:
- (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;
}
AND this the function where i am configuring the cell:
-(void)configureCell:(UITableViewCell *)cell forIndexPath:(NSIndexPath *)indexPath
{
UIImageView *imageView = (UIImageView *)[cell viewWithTag:BG_Image];
imageView.image = [UIImage imageNamed:@"event_box_bg.png"];
}
this is my EGO image code after initialization i want to know how to use this code and where
EGOImageView *_eventImageView = [[EGOImageView alloc] initWithPlaceholderImage:[UIImage imageNamed:@"placeholder.png"]];
Please help..
Thanks,
Add an EGOImageView to cell.ContentView in your method tableviewCellWithReuseIdentifier with the code you already posted.
Like this
AND in configureCell
assuming: you run your UITableViewDataSource like that: