美文网首页UITableView
UITableViewCell去掉点击效果

UITableViewCell去掉点击效果

作者: Amok校长 | 来源:发表于2016-09-05 09:17 被阅读0次

    我们在点击UITableView 的cell时,会出现阴影,如不做处理,就会一直显示,怎么样让它点击之后就消失呢?只要重写UITableView的代理方法,就可以解决,方式如下:

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

    {

    //当手指离开某行时,就让某行的选中状态消失

    [tableView deselectRowAtIndexPath:indexPath animated:YES];

    }

    第二,代码代码中修改

    UITableViewCell *cell;

    ......

    ......

    cell.selectionStyle = UITableViewCellSelectionStyleNone;

    相关文章

      网友评论

        本文标题:UITableViewCell去掉点击效果

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