iOS tableView 设置选中type样式

来源:互联网 发布:p2p网络金融平台 编辑:程序博客网 时间:2024/05/05 20:17

</pre><pre name="code" class="objc">可以给checkmark添加颜色、cell.tintColor = [UIColo redColor];
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{    if (![indexPath isEqual:_lastIndex]) {        UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];        cell.accessoryType = UITableViewCellAccessoryCheckmark;                UITableViewCell *lastCell = [tableView cellForRowAtIndexPath:_lastIndex];        lastCell.accessoryType = UITableViewCellAccessoryNone;        _lastIndex = indexPath;    }}


1 0
原创粉丝点击