UITableViewCell imageView images loading small even when they are the correct size!

Posted by Alex Barlow on Stack Overflow See other posts from Stack Overflow or by Alex Barlow
Published on 2010-12-24T23:46:39Z Indexed on 2010/12/24 23:54 UTC
Read the original article Hit count: 279

Filed under:
|
|
|

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

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c