Objective c 如何通过手势识别TTThumbsViewController中的触摸照片?
我将TTThumbsViewController子类化,以集成上传过程。作为回报,我还想集成一个删除过程 我的情况: 我在单击照片时添加了手势识别器:Objective c 如何通过手势识别TTThumbsViewController中的触摸照片?,objective-c,three20,uigesturerecognizer,ttthumbsviewcontroller,Objective C,Three20,Uigesturerecognizer,Ttthumbsviewcontroller,我将TTThumbsViewController子类化,以集成上传过程。作为回报,我还想集成一个删除过程 我的情况: 我在单击照片时添加了手势识别器: UILongPressGestureRecognizer* recognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(deleteImag
UILongPressGestureRecognizer* recognizer = [[UILongPressGestureRecognizer alloc]
initWithTarget:self action:@selector(deleteImage:)];
[self.view addGestureRecognizer:recognizer];
但是使用该代码段,我只识别行,而不是我选择的对象。TTThumbsViewController每个默认值在一行中最多有4个元素
有什么办法吗
向您致意,hijolan您始终可以使用UIView的hitTest功能
TTThumbView * selectedThumb = [self.tableView hitTest:point withEvent:nil];
if (selectedThumb && [selectedThumb isKindOfClass:[TTThumbView class]]) {
// Do something with this thumb
}
在接下来的几周里,我将尝试一下,并将这个答案标记为之后的正确答案。我还发现了另一个解决方法,我也将发布它。。。谢谢你的回答,希约兰
TTThumbView * selectedThumb = [self.tableView hitTest:point withEvent:nil];
if (selectedThumb && [selectedThumb isKindOfClass:[TTThumbView class]]) {
// Do something with this thumb
}