[英]UITableView Image in the Cell Shrinks
滚动视图后,tableview单元格中的图像就会缩小。 他们通过重新加载将大小调整为所需的大小。
大星星有我想要的大小。 较小的滚动条在滚动或触摸时出现。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *identifier = @"Cell";
NSArray *sectionData = self.dataSource[indexPath.section];
SHFriendTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
[cell updateWithData:sectionData[indexPath.row]];
return cell;
}
- (void)updateWithData:(SHFriendTableCellData *)data {
self.friendImage.contentMode = UIViewContentModeScaleToFill;
self.friendImage.image = data.image;
self.nameLabel.text = data.name;
}
更改内容模式无效。
我对图像视图有双重引用。
删除后,问题消失了,我删除了重复引用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.