- (UIView *) tableView:(UITableView *)tableView1 viewForHeaderInSection:(NSInteger)section
{
NSString *sectionTitle = [self tableView:tableView titleForHeaderInSection:section];
if (sectionTitle == nil) {
return nil;
}
UILabel * label = [[[UILabel alloc] init] autorelease];
label.frame = CGRectMake(0, 0, 320, 22);
// label.backgroundColor = [UIColor clearColor];
// label.backgroundColor = [UIColor redColor];
label.font=[UIFont fontWithName:@"Helvetica-Bold" size:14];
label.text = sectionTitle;
UIView * sectionView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 220)] autorelease];
[sectionView setBackgroundColor:[UIColor blackColor]];
[sectionView addSubview:label];
return sectionView;
}
IOS UITableView 自定义Section
最新推荐文章于 2022-08-29 13:27:08 发布