Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

John Baughman

macrumors regular
Original poster
Oct 27, 2003
100
0
I have a scroll view called bodyClockScrollView inside of which I put a UIView called bodyClock. In bodyClock I have drawn graphic and set viewForZoomingInScrollView to bodyClock. bodyClock with it's graphics scrolls and zooms perfectly inside the scroll view.

I have several subViews that respond to touches. The touch delegate methods are implemented within these subclasses.

If I add the touch subViews to the bodyClockScrollView the touches work, and the touch subViews scroll with the bodyClock. The touch subviews, however, do not zoom with the bodyClock.

If I add the touch subViews to the bodyClock subview, everything including the touch subViews scroll and zoom properly. The touch subViews, however, no longer respond to touches.

How can I get the touch subViews to both respond to touches and zoom properly. I thought I could move the touch delegate commands to the bodyClock subView, but I cannot get them to fire there either nor can I get them to work in the scrollView.
 

John Baughman

macrumors regular
Original poster
Oct 27, 2003
100
0
Problem solved

OK, I found my problem I had a subview acting as a time mask in bodyClockScrollView that I think was responding to touches. This became evident when I noticed that the touch subViews did not respond to touches while the mask was over them. Because the mask was a subview to the scroll view, it would move when zooming such that a touch subview in the bodyClock view would come out from underneath the mask and suddenly start working.

Moving the mask from bodyClockScrollView view to the bodyClock subView along with the touch subviews fixed my problem. Now all the subviews scroll and zoom properly, and respond to touches.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.