1
我在我的标题部分找不到任何文本。这是我如何设置页眉部分:viewForHeaderInSection部分不显示标题
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return myDataSource[section].otherKeyValues.count
}
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return myDataSource.count
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell: AccordionDetailTableViewCell = (NSBundle.mainBundle().loadNibNamed("AccordionDetailTableViewCell", owner: self, options: nil).first as? AccordionDetailTableViewCell)!
// cell.headerLabel!.text = "This is a test"
let currentCellData = myDataSource[indexPath.section]
cell.headerLabel!.text = currentCellData.otherKeyValues[indexPath.row].key
cell.detailLabel!.text = currentCellData.otherKeyValues[indexPath.row].value
return cell
}
override func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view: AccordionHeaderView = (NSBundle.mainBundle().loadNibNamed("AccordionHeaderView", owner: self, options: nil).first as? AccordionHeaderView)!
view.tag = section
view.delegate = self
view.titleLabel!.text = myDataSource[section].dateCreated == nil || myDataSource[section].dateCreated == "" ? " " : myDataSource[section].dateCreated
return view
}
项目显示在单元格,即使我设置view.titleLabel!.text = "Hello"
然后你好不会出现。
我使用UIViewController
实施FZAccordionTableView
我在做什么错在这里?
请实现你的tableView – Aakash
的heightForHeaderInSection方法,我已经实现了你的观点,以UITableViewAutomaticDimension现在什么也出现甚至细胞没有见过 – Sam
给他们的静态高度为并查看它们是否可见 – Aakash