viewForHeaderInSection

平成26年12月17日(水曜日)
[objc]
– (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return 40.0;
}

– (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UIView *containerView = [[UIView alloc] init];
UIButton *button1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
button1.frame = CGRectMake(10, 10, 70, 20);
[button1 setTitle:@"button1" forState:UIControlStateNormal];

[containerView addSubview:button1];
return containerView;
}
[/objc]