from:http://blog.csdn.net/hufeng825/article/details/7239542
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 23;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
NSArray *sections = ((TTSectionedDataSource *)self.dataSource).sections;
NSString *title = [sections objectAtIndex:section];
UIView* myView = [[[UIView alloc] init] autorelease];
myView.backgroundColor = [UIColor colorWithRed:0.10 green:0.68 blue:0.94 alpha:0];
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(12, 0, 90, 22)];
titleLabel.textColor=[UIColor whiteColor];
titleLabel.backgroundColor = [UIColor clearColor];
titleLabel.text=title;
titleLabel.font=[UIFont systemFontOfSize:18];// titleLabel.text=[self.keys objectAtIndex:section];
[myView addSubview:titleLabel];
[titleLabel release];
return myView;
}