美文网首页
【OC】设置UITableView的titleFooter字符串

【OC】设置UITableView的titleFooter字符串

作者: 鄒賢 | 来源:发表于2017-03-16 12:11 被阅读0次

在使用

- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section

代理方法设置字符串时,有时候需要调整字体的大小,方法如下:

- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section{
    return @"XXXX";
}

 - (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section
{
    UITableViewHeaderFooterView *header = (UITableViewHeaderFooterView *)view;
    header.contentView.backgroundColor= [UIColor whiteColor];
    [header.textLabel setTextColor:[UIColor blackColor]];
    [header.textLabel setFont:[UIFont systemFontOfSize:14]];
}

相关文章

网友评论

      本文标题:【OC】设置UITableView的titleFooter字符串

      本文链接:https://www.haomeiwen.com/subject/qradnttx.html