This question's been bugging me for a month and i've been resisting posting about it, but I can hold out no longer. Here's what's going on:
I have an app with UITableViewCell
s, all initialized as UITableViewCellStyleDefault
. For each one, I am setting the image view's image using the excellent SDWebImage package, which extends UIImageView to have a method for [UIImageView setImageWithURL:(NSURL*)url placeholderImage:(UIImage*)image].
The problem is that the images are showing up more narrow than they should be, on the tableView, but for some reason selecting a row makes it the correct size. So does scrolling the row off screen, then onscreen, then offscreen.
What method should I be using to force cells to redraw? I have found a few conflicting ideas and none of them have worked so far. I feel like there's a simple call to UITableView to UITableViewCell I'm missing out on. Also, where do I put this call? I have tried calls in cellForRowAtIndexPath
and willDisplayCell
.
Thanks for your help!
SDWebImage: https://github.com/rs/SDWebImage