UITableView iOS11 section HeaderFooterView 問題

今天跑了一下iOS 11下項目情況,碰到個坑,UITableView的顯示問題,主要是
涉及到section HeaderFooter的代理方法不執(zhí)行主要是高度,原因是tableView在iOS11默認使用Self-Sizing,estimatedSectionHeaderHeight,estimatedSectionFooterHeight默認值采用UITableViewAutomaticDimension導(dǎo)致。

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section;
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section;

處理方式1:

- (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section;  
- (nullable UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section;

處理方式2:

tableView.estimatedSectionHeaderHeight = 0;
tableView.estimatedSectionFooterHeight = 0;
最后編輯于
?著作權(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)容

  • 一、簡介 <<UITableView(或簡單地說,表視圖)的一個實例是用于顯示和編輯分層列出的信息的一種手段 <<...
    無邪8閱讀 10,968評論 3 3
  • 轉(zhuǎn)載:http://blog.csdn.net/u013263917/article/details/728957...
    Jonath閱讀 1,180評論 0 4
  • 轉(zhuǎn)載請標(biāo)注出處:m.itdecent.cn/p/1167d2ecd0ac:,以及版權(quán)歸屬黑馬程序員:http:...
    坤小閱讀 3,760評論 4 24
  • 在1.8之前,如果我們想用第三方的庫,只能獲取到源碼才可以,而不能使用編譯后的代碼,比如jar、dll、so文件。...
    UUID閱讀 5,123評論 2 9
  • 我不知道在哪里看過的話,可能是飛贊還是什么的日記吧。 1.依稀記得是這樣的:我躲在臥室里,蜷縮在床邊,無邊的黑暗向...
    00龍閱讀 354評論 0 0

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