首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >UItextView在屏幕上移动时获取放大镜位置

UItextView在屏幕上移动时获取放大镜位置
EN

Stack Overflow用户
提问于 2014-08-04 14:54:41
回答 1查看 122关注 0票数 0

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

谢谢,

EN

回答 1

Stack Overflow用户

发布于 2014-08-04 15:09:23

我们可以使用触摸方法来做到这一点。

代码语言:javascript
复制
- (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");
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25113177

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档