I set an UIImage in a UIImageView, with contentMode AspectToFit. How can I acces the frame of the resized displayed UIImage ? because imageView.image.size.width gives the original width of the image, not the resized width.
Thanks,
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Property
frameofUIImageViewwill return the frame of the displayed image.If you want change frame you should just set new
CGRect frameto yourUIImageViewFor example:
Updated:
To calculate new size you can use following code: