我正在尝试仅向表格标题添加向左滑动识别。似乎不起作用 - 尝试了在 stackoverflow 和 web 上找到的所有内容。在实际的表格单元格上工作正常,但将其添加到表格标题时......什么都没有。
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{ SnapSong *song = nil;
NSString *text = song.title; NSString *detailedText = song.albumName;
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, 80)];
view.backgroundColor = [[Globals sharedInstance] gCellBgColor];
view.tag = section;
UISwipeGestureRecognizer *recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self
action:@selector(handleSwipeLeft:)];
[recognizer setDirection:(UISwipeGestureRecognizerDirectionLeft)];
[view addGestureRecognizer:recognizer];
return view;
}
它只是不会滑动,我尝试在桌子上添加手势等......
谢谢您的帮助