Draggable UIView
I have 4 UIViews inside of a main view controller view. All I need to be able to do is drag the views aroun开发者_StackOverflow社区d the "screen". Is UIScrollView the best option for this, or is there a simpler way?
Apple's Touches sample application contains code that does just this, so you might want to check it out.
UIScrollView should be used for scrolling, not dragging. And the 4 scroll views won't work if they're overlapped so don't even think of using UIScrollView in your case.
A dedicate UIView subclass that overrides -touches*****:withEvent:
is needed. See http://github.com/erica/iphone-3.0-cookbook-/tree/master/C08-Gestures/01-Direct%20Manipulation/ for example.
精彩评论