[英]How to get the contentSize, zoomScale and contentOffset of scrollView properly in my case?
I having the following scenario: 我有以下情况:
Whenever the orientation changes, I resize the imageView to a specific aspect ratio and then set the contentSize of scrollView to the size of the contained imageView. 每当方向改变时,我都会将imageView调整为特定的宽高比,然后将scrollView的contentSize设置为所包含imageView的大小。
When the scrollView is not zoomed, the imageView resizes appropriately as per my resize code during any orientation. 当scrollView不缩放时,imageView在任何方向上都按照我的调整大小代码适当调整大小。
How can I get this corrected ? 我该如何纠正? I want the scrollView's contentSize to be such that be its internal imageView in zoomed state or not, after any orientation, the zoomed imageView should be able to pan in all directions till its edge meet the edge of its parent scrollView.
我希望scrollView的contentSize使其是否处于缩放状态的内部imageView,在任何方向之后,缩放的imageView都应该能够在所有方向上平移,直到其边缘与其父scrollView的边缘相交。
You should not resize image view. 您不应该调整图像视图的大小。 Use [imageView sizeToFit] .
使用[imageView sizeToFit]。 You should recalculate zoom of scroll view for fit ImageView.
您应该重新计算滚动视图的缩放以适合ImageView。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.