简体   繁体   中英

UIScrollview subviews not recognizing pan gesture after zooming

I have a scrollview to which I have added an image view as a subview. The contentsize of the scrollview is same as the size of the imageview (width and height). There are two buttons outside the scrollview. When I click on either on them, a small rectangle view is added as a subview to the imageview. This rectangle view can be dragged anywhere on the imageview by the user after it has been added.

This works fine until I pinch to zoom the scrollview. In the viewForZoomingInScrollView: method, I return the imageview and the zooming works fine. But in the zoomed view when I try to drag around the rectangle view, it does not move. It does not recognize the pan gestures any more. Any idea why this is happening?

This Dragable view is too small and I have to change its position so I am zomming scrollview to touchable view.

我认为您应该执行以下操作:缩放完成时,通过calling:scrollViewDidEndZooming:withView:atScale:以下方法通知委托calling:scrollViewDidEndZooming:withView:atScale:在此方法中,您将更新矩形可以移动或可能是其他calling:scrollViewDidEndZooming:withView:atScale:的视图的父视图。但是您必须使用此方法进行更新。...请把您的特定代码放在问题所在的位置。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM