UITableView(I)

作者: Harely | 来源:发表于2018-11-30 10:16 被阅读0次

消除选中cell的效果

在数据源协议代理方法:- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;中对cell进行初始化时,设置这个属性:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"commentCell"];
        if (!cell) {
                cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"commentCell"];
                cell.selectionStyle = UITableViewCellSelectionStyleNone;//设置这个属性
          }
      return cell;
}



参考资料:

相关文章

网友评论

    本文标题:UITableView(I)

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