- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
float width = tableView.bounds.size.width;
int fontSize = 18;
int padding = 10;
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, width, fontSize)];
view.backgroundColor = [UIColor colorWithWhite:0 alpha:0];
view.userInteractionEnabled = YES;
view.tag = section;
UIImageView *image = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"PlainTableViewSectionHeader.png"]];
image.contentMode = UIViewContentModeScaleAspectFit;
[view image];
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(padding, 2, width - padding, fontSize)];
label.text = @"Texto";
label.backgroundColor = [UIColor clearColor];
label.textColor = [UIColor whiteColor];
label.shadowColor = [UIColor darkGrayColor];
label.shadowOffset = CGSizeMake(0,1);
label.font = [UIFont boldSystemFontOfSize:fontSize];
[view addSubview:label];
return view;
}
网友评论