【问题标题】:iOS 7 and UITableViewDelegate with shouldHighlightRowAtIndexPathiOS 7 和 UITableViewDelegate 与 shouldHighlightRowAtIndexPath
【发布时间】:2013-10-25 15:02:29
【问题描述】:

我使用方法- (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(6_0);

iOS 6 中的这个方法在用户点击单元格时调用

Apple 写下它:

// -tableView:shouldHighlightRowAtIndexPath: 触摸时调用 连续下来。 // 对该消息返回 NO 会停止 选择过程,并且不会导致当前选定的行 触摸时失去其选定的外观。

但在 iOS 7 中,即使我尝试滚动我的 UITableView,也会调用此方法。为什么?谢谢!

【问题讨论】:

    标签: ios uitableview ios7


    【解决方案1】:

    当用户在滚动之前将手指放在单元格上时,单元格会突出显示。

    相反,你可能想使用这个:

    (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-27
      • 2019-02-10
      • 1970-01-01
      • 2014-03-03
      • 1970-01-01
      相关资源
      最近更新 更多