У меня есть приложение с таблицей стилей группы.
Я пытался настроить раздел заголовка таблицы:
- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 30)];
UILabel *userName = [[UILabel alloc] initWithFrame:CGRectMake (0,0,200,30)];
if (section != 0)userName.text = @"lalala";
[userName setFont:[UIFont fontWithName:@"HelveticaNeue" size:20]];
[headerView addSubview:userName];
[headerView setBackgroundColor:[UIColor clearColor]];
[userName setBackgroundColor:[UIColor clearColor]];
return headerView;
}
Но мои заголовки закрывают ячейки:
![enter image description here](https://i.stack.imgur.com/0qr57.png)
Почему?