Is it possible to get the X coordinate of a UIImage, that is displayed in a UIImageView when the view's scale mode is set to Center?
Image to better illustrate what I want:

It's pretty much basic maths:
CGFloat x = (imageView.frame.size.width - imageView.image.size.width) / 2;
I think no.
But there is work around solution, you can calculate image height and width and according to that you can calculate centre position by (imageView.frame.size.width-image.size.width)/2 and same thing for height.
Hope this solves your issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With