Skip to content

Instantly share code, notes, and snippets.

@qy1010
Created December 4, 2019 13:32
Show Gist options
  • Save qy1010/20f3274dc372519ec21f94edb409e8ee to your computer and use it in GitHub Desktop.
Save qy1010/20f3274dc372519ec21f94edb409e8ee to your computer and use it in GitHub Desktop.
UILabel *headerTitle = [[UILabel alloc] init];
headerTitle.text = NSLocalizedString(@"profile_language_limit", @"语言最多只能选择3个");
headerTitle.textColor = [UIColor colorNamed:@"secondaryTextColor"];
headerTitle.font = [UIFont fontWithName:@"Roboto-Regular" size:11];;
UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 40)];
headerView.backgroundColor = [UIColor colorNamed:@"mainBackgroundColor"];
[headerView addSubview:headerTitle];
[headerTitle mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(16);
make.centerY.equalTo(headerView);
}];
self.tableView.tableHeaderView = headerView;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment