Swift 3,XCode 8.3 動態原型單元格。該視圖(類CustomTableViewController: UITableViewController
)位於一個單獨的故事板中,該故事板從另一個故事板中引用,其中一個表格自身嵌入導航控制器中。UITableViewController部分頁眉和頁腳不顯示
以下方法實現:
override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat
override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat
override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView?
override func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int)
如果我在navcontroller嵌入視圖 - 控制,viewForFooterInSection
將調用和查看是可見的。 willDisplayHeaderView
仍未被調用。 編輯:它沒有嵌入它將我的CustomTableViewController設置爲初始視圖控制器。當Nav Controller是IVC時,當CustomTableViewController(嵌入在Nav Controller中)是IVC時,viewForFooterInSection被調用,viewForFooterInSection不被調用。
如果我將表格更改爲靜態單元格,willDisplayHeaderView
將被調用,並且viewForFooterInSection
將被調用,但只有在視圖嵌入到導航控制器中時纔會再次調用。
嵌入另一個導航控制器有副作用,我試圖避免,但在任何情況下willDisplayHeaderView
不會被調用。
下列方法這與實現無關的框架的內部錯誤。實施必需的方法。這不是問題。 – kos