How to handle the more than two images in the tableview?
Iam developing one application.In that i use the 4 rows for table view.Each row contain开发者_JAVA百科 the imageview.Every imageview canget the image from CAMERA.My problem is after getting the third image,images will be appear at different positions.ANd if u scroll the tableviewthen imageviews will got the black color.Images not appeared.Please tell me how to solve this one.Is this memory problem or not.please tell me.
Check out this,
UIImageView *backgroundCellImage=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 768, 80)];
backgroundCellImage.image=[UIImage imageNamed:@"ImageName1.png"];
UIImageView *separatorImage=[[UIImageView alloc] initWithFrame:CGRectMake(100, 0, 62, 80)];
separatorImage.image=[UIImage imageNamed:@"ImageName2.png"];
[cell.contentView addSubview:backgroundCellImage];
[cell.contentView addSubview:separatorImage];
[backgroundCellImage release];
[separatorImage release];
I had a similar issue, if I understand you correctly. If you are using dequeueReusableCellWithIdentifier
to get your cells (which you should do) then you will need to set the values of all properties of the cell or you will have garbage left over from previous cells.
For example:
cell.detailedTextLabel.text = @"";
If this particular cell has no detailedText. As @Akshay says you need to post your cellForRow code so we can see what is going on.
精彩评论