【发布时间】:2013-08-25 22:44:00
【问题描述】:
我搜索但不太明白为什么我们无法在 UITableView 上检测到 UITouch。我现在拥有的是:一个视图控制器,其视图中有一个表视图。请看下面的图片供您参考
在实现类中,我为每个 UITouch 方法启用断点
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event;
我注意到,当且仅当您触摸表格视图之外(橙色区域)时,才会调用这些断点
我不明白。我认为 UITableView 是 UIScrollView 的子类,它是 UIView 的子类,它是 UIResponder 的子类。这意味着应该调用 UITouch。 (如果我错了,请纠正我)
这里欢迎和赞赏所有的cmets。
【问题讨论】:
标签: ios objective-c uitableview uitouch uiresponder