Removing views from UIScrollView

Posted by mohan on Stack Overflow See other posts from Stack Overflow or by mohan
Published on 2009-01-29T22:19:22Z Indexed on 2010/05/25 20:01 UTC
Read the original article Hit count: 334

Filed under:

I have two UIScrollViews that I move images between. The user can drag and forth between the scroll views. I am trying to animate the movement of the image from one scroll view to another. In -touchesMoved (handled in my UIViewController which has two custom UIScrollViews that intercept touch and sends to my UIViewController), I am trying to set the "center" of my UIImageView that is being moved. As it is moved, the image gets hidden behind the UIScrollView and not visible. How do I make it appear on top of the UIScrollView? I am able to handle the -touchesEnded properly by animating in the destination scroll view.

I am also confused about -convertPoint:fromView: usage in the iPhone Programming Guide (See Chapter 3, Event Handling). If the touch coordinates are in window coordinates, to change my view (UIImageView inside a UIScrollView which is inside a UIView and inside a window) center don't I have to use -convertPoint:toView:, i.e.,

imageView.center = [self.view.window convertPoint:currentTouchPosition toView:imageView];

What am I missing?

© Stack Overflow or respective owner

Related posts about cocoa-touch