【问题标题】:Table View Cell highlight when user swipe用户滑动时表格视图单元格突出显示
【发布时间】:2015-07-06 06:13:07
【问题描述】:

我尝试为UITableViewCell 进行行操作,我遇到问题在滑动时突出显示。用户并没有真正选择单元格,他只是向左滑动。

我的shouldHighlightRowAtIndexPath 看起来像这样:

    - (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath {

       // Sets the inner rectangle to the selected color
        [cell setCellColorWithString:COLORS_ARRAY[4]];
        
        return YES;
    }

如果这是正确的做法,我的editActionsForRowAtIndexPath 会取消突出显示,但它调用得太晚了:/

当用户开始/停止向左/向右滑动时,我可以得到任何事件吗?

任何帮助都会很棒。 提前致谢。

【问题讨论】:

    标签: ios iphone uitableview uitableviewrowaction


    【解决方案1】:

    您可以在表格视图中添加滑动手势识别器,找到与滑动触摸点匹配的单元格,然后取消突出显示它。

    this answer

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多