设置Footer section
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return 21.0f;
}
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
NSString *sectionTitle = [selftableView:tableView titleForFooterInSection:section];
if (sectionTitle == nil) {
return nil;
}
UILabel *label = [[UILabelalloc] init];
label.frame = CGRectMake(20,8, 320, 21);
label.lineBreakMode=NSLineBreakByWordWrapping;
label.numberOfLines=0;
label.backgroundColor = [UIColorclearColor];
label.textColor = [UIColorlightGrayColor];
label.font = [UIFontboldSystemFontOfSize:13];
label.text = sectionTitle;
UIView *view = [[UIViewalloc] init];
[view addSubview:label];
return view;
}
- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section
{
switch (section) {
case 0:
return @"";
break;
case 1:
return@"xxxxxxxxxxxxxxx";
break;
case 2:
return @"";
break;
default:
return @"";
break;
}
}
设置Header section相同