`
修博龙泉
  • 浏览: 314212 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

uitableview 取消选择颜色

 
阅读更多
- (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];    
    }
}


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics