Guest User

Untitled

a guest
Jun 19th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. - (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
  2. {
  3. UIView *headerView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 30)] autorelease];
  4. if (section == integerRepresentingYourSectionOfInterest)
  5. [headerView setBackgroundColor:[UIColor redColor]];
  6. else
  7. [headerView setBackgroundColor:[UIColor clearColor]];
  8. return headerView;
  9. }
  10.  
  11. UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(10, 3, tableView.bounds.size.width - 10, 18)] autorelease];
  12. label.text = @"Section Header Text Here";
  13. label.textColor = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.75];
  14. label.backgroundColor = [UIColor clearColor];
  15. [headerView addSubview:label];
Add Comment
Please, Sign In to add comment