【发布时间】:2011-09-09 17:52:39
【问题描述】:
如何向 UIScrollView 的子视图添加拖动事件?结构如下:
-UIView
-UIScrollView
-UIView
-UIView
...
我尝试从以下内容开始:
-(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *aTouch = [touches anyObject];
CGPoint location = [aTouch locationInView:self.superview.superview];
[UIView beginAnimations:@"Dragging A DraggableView" context:nil];
self.frame = CGRectMake(location.x, location.y,
self.frame.size.width, self.frame.size.height);
[UIView commitAnimations];
}
但是什么也没发生!帮助将不胜感激。 谢谢
【问题讨论】:
标签: objective-c ios drag-and-drop