TableView section 頭標(biāo)題默認大寫的解決

TableView section 頭標(biāo)題默認大寫的解決


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)];
//注意這里調(diào)整不了高度
    
    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;}

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 概述在iOS開發(fā)中UITableView可以說是使用最廣泛的控件,我們平時使用的軟件中到處都可以看到它的影子,類似...
    liudhkk閱讀 9,296評論 3 38
  • { 24、Sqlite數(shù)據(jù)庫 1、存儲大數(shù)據(jù)量,增刪改查,常見管理系統(tǒng):Oracle、MSSQLServer、DB...
    CYC666閱讀 1,050評論 0 1
  • Spring Cloud為開發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見模式的工具(例如配置管理,服務(wù)發(fā)現(xiàn),斷路器,智...
    卡卡羅2017閱讀 136,545評論 19 139
  • IOS中UITableView使用總結(jié) 一、初始化方法 - (instancetype)initWithFrame...
    脫下國際籃化身程序猿閱讀 816評論 0 2
  • 就像上一章講到的,這一章里對思維的發(fā)散性和強度匹配做了進一步的解釋。 你幾乎對眼前出現(xiàn)的所有事物都會有直覺和想法,...
    戴慧蘭閱讀 955評論 0 0

友情鏈接更多精彩內(nèi)容