我有一个不包含任何文本的UITextView。当我长按这个视图时,放大镜就会出现在屏幕上,我可以用放大镜移动手指。问题是:当我移动放大镜时,有没有办法捕捉手指的动作来获得放大镜的位置?
谢谢,

发布于 2014-08-04 15:09:23
我们可以使用触摸方法来做到这一点。
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
NSLog(@"touchesBegan");
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
[super touchesBegan:touches withEvent:event];
NSLog(@"touchesMoved");
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
NSLog(@"****touchesEnded");
[self.nextResponder touchesEnded: touches withEvent:event];
NSLog(@"****touchesEnded");
[super touchesEnded:touches withEvent:event];
NSLog(@"****touchesEnded");
}
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event{
[super touches... etc];
NSLog(@"touchesCancelled");
}https://stackoverflow.com/questions/25113177
复制相似问题