美文网首页
TableView section 头标题默认大写的解决

TableView section 头标题默认大写的解决

作者: test158888 | 来源:发表于2017-06-13 16:15 被阅读258次

TableView section 头标题默认大写的解决


Simulator Screen Shot 2017年6月13日 16.21.40.png
-(NSString*)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
    
    JYSetterGroup *group = self.groups[section];
    return group.headTitle;
    
}

增加方法-(UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:

-(UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
   
    UILabel *headerLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 20)];
//注意这里调整不了高度
    
    if (section == 0) {
        headerLabel.text = @"小写a";
    }
    else {
        headerLabel.text = @"headBBBBBBB";
    }

    return headerLabel;
}

-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 10;

}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 27;}

相关文章

网友评论

      本文标题:TableView section 头标题默认大写的解决

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