【OC】设置UITableView的titleFooter字符串

2017-03-16  本文已影响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]];
}
上一篇 下一篇

猜你喜欢

热点阅读