Ios AFNetworking setImageWithURL:占位符图像:大小错误
将UIImageView上的ImageWithURL设置为UITableViewCell时出现问题。Ios AFNetworking setImageWithURL:占位符图像:大小错误,ios,uitableview,uiimageview,afnetworking,Ios,Uitableview,Uiimageview,Afnetworking,将UIImageView上的ImageWithURL设置为UITableViewCell时出现问题。 这是呈现的表视图。在这之前的左侧,我按下了UITableViewCell,在这之后的右侧,我按下了它 这是我的tableView:cellForRowAtIndexPath方法: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
这是呈现的表视图。在这之前的左侧,我按下了UITableViewCell,在这之后的右侧,我按下了它 这是我的tableView:cellForRowAtIndexPath方法:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"AddFriendCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
NSDictionary *user = self.result[indexPath.row];
cell.textLabel.text = [NSString stringWithFormat:@"%@ %@", user[@"firstname"], user[@"lastname"]];
if (user[@"picture"]) {
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://jawbone.com/%@", user[@"picture"]]];
[cell.imageView setImageWithURL:url placeholderImage:cell.imageView.image];
}
return cell;
}
我昨晚也有类似的问题。之所以会发生这种情况,是因为UITableViewCell覆盖了imageview属性上的约束,并且由于某些原因具有一些不可靠的功能。我知道这并不是最清楚的解释,因为我最终没有找到问题的确切根源,但我找到了解决办法 我的解决办法是: