您的位置:首页 > 产品设计 > UI/UE

取消UITableViewCell的选中状态

2015-09-22 10:54 585 查看
设置cell的选中属性为如下就没有点击效果了

cell.selectionStyle = UITableViewCellSelectionStyleNone;

只需要在
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
中加入一行代码就可以了
[tableView
deselectRowAtIndexPath:indexPath animated:YES];
然后再写你其他代码就可以了

全选
复制放进笔记
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];// 取消选中
//其他代码
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: