1
Я пытаюсь создать пользовательский раздел TableView. Это выше, чем обычный заголовок раздела.Пользовательский раздел UITableView, не увеличивающий высоту
Проблема заключается в том, что, например, я увеличиваю высоту с 18 до 30. Ничего страшного не получится. Что я делаю не так?
у меня есть этот код:
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, 18)];
/* Create custom view to display section header... */
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, tableView.frame.size.width, 18)];
[label setFont:[UIFont boldSystemFontOfSize:12]];
NSString *string =[[sectionsArray objectAtIndex:section] objectForKey:@"league"];
/* Section header is in 0th index... */
[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;
}
Посмотреть UITableViewDelegate 'tableView: heightForHeaderInSection:' – vokilam