nicklockwood/AsyncImageView — Issue #6: Update ImageView frame when the loading completes
Author: bolshas
Created: 2011-11-20 16:38:16+00:00
State: open

Hi,

I am trying to display the image in a UIScrollView and therefore need to update the contentsize and the bounds of the imageview to the actual size of the image being loaded.

I have implemented the [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(imageLoaded:) name:AsyncImageLoadDidFinish object:nil];

and in this method imageLoaded I am trying to update the frame of the imageview.

The problem is that sometimes it updates, and sometimes not (i. e. sometimes the bounds stay the same as the dummy image's).

Since the images are loaded from the outside, their dimensions are often not known. Perhaps you could suggest how the holding view frame could be updated to match the size of the downloaded image?

Andrius