I would like to display the image I got from AlamofireImage in the same size.

Asked 2 years ago, Updated 2 years ago, 130 views

I would like to dynamically retrieve and display the image in af_setImageWithURL of AlamofireImage, but I would like to change the size of the UIImageView according to the size of the image to be retrieved.Is this possible?

swift ios alamofire

2022-09-30 16:07

1 Answers

Assume that the image you get is myImage (UIImage type)

let myImageView=UIImageView (frame: CGRectMake(0,0,(myImage?.size.width)!,(myImage?.size.height)!))
myImageView.image=myImage

If you write the code, the size of the UIImageView will be the size of the image.
I'm sorry if it's not the answer I need.


2022-09-30 16:07

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.