tableView 的Cell的选中状态

来源:互联网 发布:java future异步返回 编辑:程序博客网 时间:2024/06/10 15:15

有时我们不想显示cell的选中状态,一般使用这种方法

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    //some functions
    ......

    // 取消选中状态
    [tableView deselectRowAtIndexPath:indexPath animated:NO];
}

但是其实可以看出,是选择后然后执行了 取消选择,那么我们其实可以直接在cell for rows中可以直接设置

cell.selectStyle =   ...none 就可以了.

这样点选不会有任何变化.

0 0
原创粉丝点击