开发者

touchesMoved out of the self view

I'm working on an important project at my job place, and having a problem which I'm stack with:

I have 2 views in a line (1 scroll view w开发者_开发技巧ith images, and the other is just a UIImageView), I would like to make it able to move an image from the scroll view into the UIImageView), I could successfully recognize and move the image from the scrollView, but the problem is when the movement goes out of the scrollView the image dropped disappears behind and could not reach the road to the imageView.

any suggestions please?


Create a subclass of a UIView and display the image on this view. Then implement the methods touchesDidBegin, touchesMoved, touchesCancelled on this subclass. Use this new UIView in your scrollview for the images you want to drag, and make sure the scrollview.clipsToBounds = NO.

In touchesMoved, adjust the position of the view's frame and when touchesEnd, get the position of the frame to determine if it's in the other view.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜