Reputation:
How can i set png image with transparency for background of section's header in UiTableView?
Upvotes: 1
Views: 4541
Reputation: 7506
I think you will need to create a UIView with a UIImageView in it.
Something like that :
- (void) createHeader
{
header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 50)];
header.backgroundColor = [UIColor colorWithWhite:0 alpha:0];
UIImageView *headerImage = [[UIImageView alloc] initWithImage:yourImage];
[header addSubview:headerImage];
[headerImage release];
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
return header;
}
Upvotes: 8