iPhone/iOS: How to implement Drag and Drop for subviews of a Scrollview?

后端 未结 5 1205
盖世英雄少女心
盖世英雄少女心 2020-12-09 20:50

I am having an horizontal scrollview in an UIViewController, where i have many images in small sizes. I am keeping the images in scrollview because the images a

5条回答
  •  青春惊慌失措
    2020-12-09 21:18

    I created an example which illustrates how to drag and drop between two or more views: http://www.ancientprogramming.com/2012/04/05/drag-and-drop-between-multiple-uiviews-in-ios/

    I found it a good idea to register the gesture recognizer to a different view than the actual views being dragged. This will make sure the gestures continue even though the dragged view changes its 'parent' view.

    Maybe it can give some inspiration

提交回复
热议问题