Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 iOS 上,我有一个 UIScrollView 子类。在缩放手势期间,我需要区分缩小和放大。做这个的最好方式是什么?
谢谢, 道格
在UIScrollViewDelegate'sscrollViewWillBeginZooming:withView:中,存储您的zoomScale当前UIScrollView; 将存储的值与zoomScalein进行比较scrollViewDidEndZooming:withView:atScale:以确定它是放大还是缩小。如果该值增加,则为放大;否则,这是一个缩小。
UIScrollViewDelegate
scrollViewWillBeginZooming:withView:
zoomScale
UIScrollView
scrollViewDidEndZooming:withView:atScale: