- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
//取消选中颜色
UIView *backView = [[UIView alloc] initWithFrame:cell.frame];
cell.selectedBackgroundView = backView;
cell.selectedBackgroundView.backgroundColor = [UIColor clearColor];
//取消边框线
[cell setBackgroundView:[[UIView alloc] init]]; //取消边框线
cell.backgroundColor = [UIColor clearColor];
}
//在navigation中tableviewCell选中后返回无选中项
//单击一个cell
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = (UITableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
if(cell.tag == 0){
//注销cell单击事件
cell.selected = NO;
}else {
[tableView deselectRowAtIndexPath:[tableView indexPathForSelectedRow] animated:YES]; //取消选中项
BabyScheduler *babyScheduler=[listData objectAtIndex:indexPath.row-1];
[delegate showVaccinationView:babyScheduler];
}
}
uitableview 取消选择颜色
最新推荐文章于 2018-06-25 20:17:05 发布