Question

I am putting an image into an IKImageView, and immediately sizing it to fit. Whenever I do this, the image originally appears at 1-1 size (huge) and then resizes down, which would be fine if the animation was smooth. However, the animation looks ... fluttery? There are big blocks, like 2 inches square, of the image that appear and shrink independently of each other. The effect is a little annoying, and almost to the level where it might give an epileptic a seizure... (I'm exaggerating a little).

Is this a bug in IKImageView? Is it a bug in the animation? Will it go away if I turn off the animation (How do I do that? setAnimates: NO doesn't seem to do anything, nor does overloading animates to return NO in my subclass...

EDIT: addedcode:

NSImage* image = [doc currentImage];
[imageView setImage: image];
[imageView zoomImageToFit: self];

This is in the app controller, so self is the application (or plugin, depending on which version I'm looking at)

Was it helpful?

Solution

If you tell the IKImageView to autoresize, then it won't animate the new image to the new size and the artefacts will not be a problem. The image will be sized to fit in the image view immediately.

imageView.autoresizes = YES;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top