Ios 当我滚动时,单元格图像视图变大
我是Objective-C新手,我想在表格视图中显示图像。这些图像来自一个URLIos 当我滚动时,单元格图像视图变大,ios,objective-c,uitableview,uiimage,Ios,Objective C,Uitableview,Uiimage,我是Objective-C新手,我想在表格视图中显示图像。这些图像来自一个URL [cell.imageView setImageWithURL:[NSURL URLWithString:[[stories objectAtIndex:storyIndex] objectForKey:@"url"]] placeholderImage:[UIImage imageNamed:@"Icon-60.png"]]; 图像显示正确,但当我滚动时,图像会变大 我想做的是: cell.imageView.
[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的默认图像视图边界、帧属性是只读的,因此您应该构建自己的类,扩展UITableViewCell以创建自己的UIImageView,然后如果您的滚动算法正确,则一切都应该正常