- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString * CustomCellIdentifier = @"SetViewCell"; UITableViewCell *cell = [self.tableview dequeueReusableCellWithIdentifier:CustomCellIdentifier]; if (cell == nil){ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CustomCellIdentifier]; cell.accessoryType = UITableViewCellAccessoryCheckmark; [cell.textLabel setText:[pickerArray objectAtIndex:indexPath.row]]; } [tableView deselectRowAtIndexPath:indexPath animated:YES]; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; [tableView cellForRowAtIndexPath:indexPath].accessoryType = UITableViewCellAccessoryNone; }
IOS UITableView显示打钩选项与点击取消打钩示例 (个人)
最新推荐文章于 2018-07-16 13:28:40 发布