Last active
August 29, 2015 14:03
-
-
Save sanketfirodiya/9b24268a9372d24a6c7f to your computer and use it in GitHub Desktop.
HeaderView for UITableView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { | |
UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, 18)]; | |
UILabel *headerLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 3, tableView.frame.size.width, 18)]; | |
[headerLabel setFont:[UIFont boldSystemFontOfSize:12]]; | |
headerLabel.textColor = [UIColor darkGrayColor]; | |
headerLabel.text = @"Share with friends"; | |
[headerView addSubview:headerLabel]; | |
headerView.backgroundColor = [UIColor clearColor]; | |
return headerView; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment