I have two scroll-views placed side by side and they can be zoomed individually. I’ve done this by putting my view inside a scrollview and setting the zoom-scale for the scroll-views. So far, it works fine! Now, there’s a new requirement to zoom the two images together so that if I zoom one image, the other is zoomed automatically with the same zoom scale. I was given the roambi app as reference in which two scrollviews can be scrolled together by scrolling either one of them for convenience during comparison. Basically, what I’m doing is also comparison between the two views. I’ve gone through scrollview delegate methods but was unable to achieve the required results. How do I do this?
Share
I had implemented something similar a while ago (I did it for buttons). This is how I did it:
Take two
UIScrollViews and reference them (I’ve usedfirstScrollViewandsecondScrollView)Take two
UIButtons and reference them (I’ve usedfirstImgBtnandsecondImgBtn). Set the delegates to both the scrollviews and use the following delegate methods:This can be applied to any subclass of
UIView-in your case it will beUIImageViews