【发布时间】:2014-04-01 19:14:06
【问题描述】:
我在屏幕上拖动了一张图像,但是无论我触摸屏幕的哪个位置,图像都会出现在我的手指上并开始拖动,对于我观看的所有视频以及所有博客和文章,人们正在展示的所有内容都是怎么做……这不是我想要的……我想要的是只有在我触摸图像时才开始拖动图像……这是我的代码
-(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *Drag = [ [ event allTouches ] anyObject ];
Dot.center = [ Drag locationInView: self.view ];
[self checkCollison];
}
谢谢
【问题讨论】:
-
使用 UIPangesture 代替这个