I have been unable to find the answer for this issue I am having.
I have a UIImageView inside a UIScrollView, and I would like the center its content vertically.
Right now, the only way I have been able to do this is by setting the scroll view's contentInset based on the height of the UIImageView size, but this is not a perfect solution; it just increases the size of the UIImageView, making the UIScrollView 'think' its content is bigger, and adds these black bars to the top.
I've tried to get help from:
UIScrollView with centered UIImageView, like Photos app
and
Center content of UIScrollView when smaller
But have not been able to solve it using those answers.