Reputation: 901
I have a problem when I setImageWithURL on an UIImageView into an UITableViewCell.
Here is the table view rendered. On the left before that I pressed on the UITableViewCell and on the right after that I pressed it.
Here is my tableView:cellForRowAtIndexPath method :
- (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;
}
Upvotes: 1
Views: 812
Reputation: 1568
I just had a very similar problem last night. It happens because the UITableViewCell overrides the constraints on an imageview property, and for some reason has some unreliable functionality. I understand that this isn't exactly the most clear explanation as I did not ultimately figure out the exact source of the problem, but I was able to find a workaround.
The fix for me was to:
Upvotes: 1