How to create a grouped TableView without using a TableViewController

走远了吗. 提交于 2020-01-06 23:52:07

问题


I have a UITableView and I would like it to have 2 sections. I now know that you can only have grouped sections if you're using a UITableViewController and if you're using static cells, neither of which I am. Is that I want to do possible? If so where can I turn for help on setting this up. It seems like every tutorial I have found is for the example of using a UITableViewController.


回答1:


Setting the tableView's style property to .Grouped and return 2 from numberOfSections...-method should yield a good result. Where does this standard approach fail?



来源:https://stackoverflow.com/questions/35166864/create-grouped-tableview-without-using-tableviewcontroller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!