您可以尝试以下方法:
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ UIView *view = [[UIView alloc] initWithframe:CGRectMake(0, 0, tableView.frame.size.width, 18)]; UILabel *label = [[UILabel alloc] initWithframe:CGRectMake(10, 5, tableView.frame.size.width, 18)]; [label setFont:[UIFont boldSystemFontOfSize:12]]; NSString *string =[list objectAtIndex:section]; [label setText:string]; [view addSubview:label]; [view setBackgroundColor:[UIColor colorWithRed:166/255.0 green:177/255.0 blue:186/255.0 alpha:1.0]]; //your background color... return view;}


