簡體   English   中英

UItableview變量節標題高度和內容

[英]UItableview variable section header height and content

有沒有人知道如何創建具有可變高度部分標題和內容的UITableView,類似於Facebook iPhone應用程序?

所以我想要一些標題有文字(例如收藏夾,應用程序等等)。 但是有些節標題我只想要沒有文字而是5像素高的分隔符(例如在Facebook Messenger app分隔符中)。

例:

FAVORITES <-- Header:
 fav1
 fav2
 fav3

APPS   <-- Header: this is all apps header
 app1  <-- these are the most used apps
 app2
=====  <-- Header: this is a header with no text (see Facebook Messenger)
 app3  <-- apps not used in a long time
 app4

FRIENDS <-- Header:
 Sam
 Tina 

所以我需要部分標題的動態內容。 這些部分每次都需要按一定的順序排列。 最后,節頭必須具有一定的高度。

您將要引用UITableViewDelegate和UITableViewDatasource文檔。

具體這兩種方法:

- tableView:heightForHeaderInSection:

- tableView:viewForHeaderInSection:

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM