有谁知道如何创建具有可变高度部分标题和内容的 UITableView,类似于 Facebook iPhone 应用程序?
所以我想要一些标题有文本(例如收藏夹、应用程序等...)。但有些部分标题我只想要没有文本,而是 5 像素高的分隔符(例如,在 Facebook Messenger 应用程序分隔符中)。
例子:
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:
和
关于objective-c - UItableview可变部分标题高度和内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12979591/