objective c - Image aspect ratio change after inserting it into imageview -
so i'm trying load image photographic camera image view. i've got done, images aspect ratio changes.
i tried setting content mode imageview no effect. here how it:
uiimage *picture=[uiimage imagewithdata:slika]; imageview = uiviewcontentmodescaleaspectfit; [imageview setimage:picture forstate:uicontrolstatenormal];
any ideas?
is image view own view? or it's, example, cell's default imageview?
and should write so:
imageview.contentmode = uiviewcontentmodescaleaspectfit; imageview.image = [uiimage imagenamed:picture];
or
[imageview setimage:picture];
there no method [imageview setimage:picture forstate:uicontrolstatenormal];
uiimageview, available uibutton (and may other uicontrols, uiimageview not subclass of uicontrol - direct subclass of uiview) . button not scale images preserving aspect ratio.
objective-c xcode uiimageview
No comments:
Post a Comment