美文网首页
cell选中

cell选中

作者: 胖红Red | 来源:发表于2017-08-24 10:31 被阅读11次
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
MomentsReportCell *cell = [MomentsReportCell getCellWith:tableView];
if (_selectedIndex == indexPath.row) {
    cell.imvSelected.hidden = NO;
    _beforeSelectedIndex = indexPath;
}
if (_arrDataCause.count > 0) {
    cell.lblTextLeft.text = DSStringValue(_arrDataCause[indexPath.row][@"reportComment"]);
}
return cell;
}

  - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
//去除之前选中的
MomentsReportCell *beforeCell = [tableView cellForRowAtIndexPath:_beforeSelectedIndex];
beforeCell.imvSelected.hidden = YES;
//给选中的限制按钮
MomentsReportCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.imvSelected.hidden = NO;
_selectedIndex = indexPath.row;
[_tbvMomentsReport reloadData];
}

相关文章

网友评论

      本文标题:cell选中

      本文链接:https://www.haomeiwen.com/subject/wdbsdxtx.html