So I’m trying to load an image from camera into image view. I’ve got it done, but images aspect ratio changes.
I tried setting content mode for imageview but no effect.
Here is how i do it:
UIImage *picture=[UIImage imageWithData:slika];
imageview = UIViewContentModeScaleAspectFit;
[imageview setImage:picture forState:UIControlStateNormal];
Any ideas?
Is image view your own view? Or it’s, for example, cell’s default imageView?
And you should write so:
or
There is no method
[imageview setImage:picture forState:UIControlStateNormal];for UIImageView, it only available for UIButton (and may be for some other UIControls, but UIImageView not subclass of UIControl – it direct subclass of UIView) . But button does not scale images preserving aspect ratio.