ios - Load an image in UIImageView and resize the container - swift -
i have s3 link using need load image in uiimageview. don't have dimensions of image me. have defined mainimageview (leading , trailing constraints) in storyboard
in code, loading image using:
mainimageview.setimagewith(url(string: ("https:" + (content?.imagepath)!)), placeholderimage: nil) do have way of resizing container once image loads? want container take dimensions (height , width) of image. heard there called content wrap in android achieve same. however, unable find equivalent in ios.
if using autolayout, dont have uiimageview has intrinsic size makes take width , height of image. in .xib or .storyboard need position image view can resolve position(horizontal , vertical). size can provide default image(ow autolayout show error).
when change image @ runtime, imageview take size of image.
Comments
Post a Comment