滚动时单元格图像视图变大

Cell image view geting bigger when i scroll

我是 Objective-C 的新手,我想在 table 视图中显示图像。图片来自 URL.

[cell.imageView setImageWithURL:[NSURL URLWithString:[[stories objectAtIndex:storyIndex] objectForKey:@"url"]] placeholderImage:[UIImage imageNamed:@"Icon-60.png"]];

图像显示正确,但当我滚动时,它们变大了。

我想做的是:

cell.imageView.bounds = CGRectMake(0,0,10,10);

但它不起作用。

首先UITableViewCell的默认imageView的bounds,frame属性是只读的,所以你应该自己构建class扩展UITableViewCell来创建你自己的UIImageView,然后如果你的滚动算法正确无误。