[英]Table View Cell highlight when user swipe
I try to make row action for UITableViewCell
and I have a problem with highlight while swipe. 我尝试为
UITableViewCell
进行行动, 我在刷卡时遇到问题 。 The user doesn't really select the cell, he simply swipe to left. 用户并没有真正选择单元格,他只需向左滑动即可。
My shouldHighlightRowAtIndexPath
looks like this: 我的
shouldHighlightRowAtIndexPath
看起来像这样:
- (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath {
// Sets the inner rectangle to the selected color
[cell setCellColorWithString:COLORS_ARRAY[4]];
return YES;
}
And my editActionsForRowAtIndexPath
cancel the highlight if this is the right thing to do, but it called too late :/ 如果这是正确的事情,我的
editActionsForRowAtIndexPath
取消突出显示,但它调用太晚了:/
Can I get any event when the user start/stop swipe to left/right? 当用户开始/停止向左/向右滑动时,我可以获得任何事件吗?
Any help will be great. 任何帮助都会很棒。 Thanks in advance.
提前致谢。
You could add a swipe gesture recogniser to the table view, find the cell that matches the touch point of the swipe and then unhighlight it. 您可以向表格视图添加滑动手势识别器,找到与滑动触摸点匹配的单元格,然后取消它。
See this answer 看到这个答案
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.