<分区>
<分区>
我在我的 View Controller 中添加了一个普通的 UITableView。现在我需要在同一个 View Controller 中针对不同的条件同时显示普通 TableView 和组 TableView 。
如何在同一 View Controller 中将 UITableView 的样式从普通样式转换为组样式?
最佳答案
如果你继承了 UITableViewController,你可以再次初始化 tableView。
Objective-C :
self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
swift 4:
self.tableView = UITableView(frame: CGRect.zero, style: .grouped)
关于ios - 如何以编程方式将 UITableView 样式从普通样式转换为组样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48314937/