Используйте приведенный ниже код для ответа
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *tempView=[[[UIView alloc]initWithFrame:CGRectMake(0,0,300,44)]autorelease];
tempView.backgroundColor=[UIColor redColor];
UILabel *tempLabel=[[UILabel alloc]initWithFrame:CGRectMake(0,0,300,44)];
tempLabel.backgroundColor=[UIColor clearColor];
tempLabel.text=@"MY HEADER";
[tempView addSubview: tempLabel];
[tempLabel release];
return tempView;
}
Это даст вам заголовок redColor. Измените цвет согласно вашему требованию ...
Отредактировано (согласно Harsh):
Поскольку представление в заголовке будет перекрывать вашу первую ячейку, увеличьте высоту заголовка
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 50;
}
СЧАСТЛИВОЕ КОДИРОВАНИЕ ........