问题
I have tried it with
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, 100)];
headerView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
headerView.opaque = NO;
headerView.backgroundColor= [UIColor blackColor];
return [headerView autorelease];
}
But how can i set a BackgroundImage to the sections?
Thanks much
回答1:
You can set the background colour to a pattern with image:
headerView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"myBackground.png"]];
来源:https://stackoverflow.com/questions/10857241/set-backgroundimage-to-uitableview-section-viewforheaderinsection