【发布时间】:2014-09-26 14:26:51
【问题描述】:
我有一个 UITextView,其中不包含任何文本。当我长按这个视图时,放大镜出现在屏幕上,我可以用放大镜移动手指。问题是:当我在移动放大镜时,有没有什么办法可以捕捉到这个手指的动作来获得放大镜的位置?
谢谢,
【问题讨论】:
标签: ios cocoa-touch ios7 uitextview
我有一个 UITextView,其中不包含任何文本。当我长按这个视图时,放大镜出现在屏幕上,我可以用放大镜移动手指。问题是:当我在移动放大镜时,有没有什么办法可以捕捉到这个手指的动作来获得放大镜的位置?
谢谢,
【问题讨论】:
标签: ios cocoa-touch ios7 uitextview
我们可以使用触摸方法来做到这一点。
- (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");
}
【讨论】: