修改tableview的section title的字体


- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {

NSString *key = [keys objectAtIndex:section];


// create the parent view that will hold header Label
UIView* customView = [[UIView alloc] initWithFrame:CGRectMake(40.0, 0.0, 300.0, 44.0)];

UILabel *headerLabel = [[UILabel alloc] initWithFrame:CGRectZero];
headerLabel.backgroundColor = [UIColor clearColor];
headerLabel.opaque = NO;
headerLabel.textColor = [UIColor blackColor];
headerLabel.highlightedTextColor = [UIColor whiteColor];
headerLabel.font = [UIFont italicSystemFontOfSize:20];
headerLabel.frame = CGRectMake(40.0, 0.0, 300.0, 44.0);
headerLabel.text = key;

[customView addSubview:headerLabel];
[headerLabel release];

return [customView autorelease];
}

你可能感兴趣的:(header,UIView)