UITableViewCell imageView images loading small even when they are the correct size!
- by Alex Barlow
Im having an issue whilst loading images into a UITableViewCell after an asynchronous download and placement into an UIImage variable..
The images appear smaller than they actually are! But when scrolled down and scrolled back up to the image, or the whole table is reloaded, they appear at the correct size...
Here is a code excerpt...
- (void)reviewImageDidLoad:(NSIndexPath *)indexPath
{
ThumbDownloader *thumbDownloader = [imageDownloadsInProgress objectForKey:indexPath];
if (thumbDownloader != nil)
{
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:thumbDownloader.indexPathInTableView];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.4];
[self.tableView cellForRowAtIndexPath:indexPath].imageView.alpha = 0.0;
[UIView commitAnimations];
cell.imageView.image = thumbDownloader.review.thumb;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.4];
[self.tableView cellForRowAtIndexPath:indexPath].imageView.alpha = 1.0;
[UIView commitAnimations];
}
}
Here is an image of the app just after calling this method..
http://www.flickr.com/photos/arbarlow/5288563627/
After calling tableView reloadData or scrolling around the appear correctly, go the the next flickr image, to see the normal result, but im sure you can guess that..
Does anyone have an ideas as to make the images appear correctly? im absolutely stumped?!
Regards,
Alex
iPhone noob