ios - How to resize a fixed width and height UIImageView with auto layout -
i have view named myview
half screen , sit @ top of screen.
inside view added uiimageview
120x120 size sits in center of myview
(horizontally , vertically). inside ib, satisfy constraints(x & y) need set fixed width , height image, after set center horizontally , center vertically.
but fixed height , width, image doesn't resize when changing screen size. want image resize when running on iphone5 or iphone 4s, because myview
resize. need image should depend on myview
size.
how achieve ?
set imageview.cliptobounds = yes
, , set imageview.contentmode = uiviewcontentmodescaleaspectfit;
update talking imageview not image, in case not resize due constant width , height, 1 thing, create iboutlet of constraint , change there values when required, or can set aspect ratio superview
Comments
Post a Comment