Skip to content

Instantly share code, notes, and snippets.

@premedios
Created May 14, 2014 13:06
Show Gist options
  • Save premedios/d1d68c97589aab8ea66d to your computer and use it in GitHub Desktop.
Save premedios/d1d68c97589aab8ea66d to your computer and use it in GitHub Desktop.
Table header with UILabel
UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, self.tableView.bounds.size.width, 50.0f)];
headerView.backgroundColor = [UIColor colorWithRed:0.31f green:0.77f blue:0.83f alpha:1.0f];
[self.navigationController setNavigationBarHidden:YES];
self.view.backgroundColor = [UIColor colorWithRed:0.31f green:0.77f blue:0.83f alpha:1.0f];
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, 0.0f, self.tableView.bounds.size.width, 44.0f)];
titleLabel.textColor = [UIColor whiteColor];
[headerView addSubview:titleLabel];
self.tableView.tableHeaderView = headerView;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment