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

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;}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 概述在iOS开发中UITableView可以说是使用最广泛的控件,我们平时使用的软件中到处都可以看到它的影子,类似...
    liudhkk阅读 9,118评论 3 38
  • { 24、Sqlite数据库 1、存储大数据量,增删改查,常见管理系统:Oracle、MSSQLServer、DB...
    CYC666阅读 1,004评论 0 1
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,273评论 19 139
  • IOS中UITableView使用总结 一、初始化方法 - (instancetype)initWithFrame...
    脱下国际篮化身程序猿阅读 783评论 0 2
  • 就像上一章讲到的,这一章里对思维的发散性和强度匹配做了进一步的解释。 你几乎对眼前出现的所有事物都会有直觉和想法,...
    戴慧兰阅读 797评论 0 0