一.如何配置section
参考:https://www.youtube.com/watch?v=-yeaLC0jgss
配置无标题section:
let sections = [" "," "]
不能直接"",IDE会默认为没有section
配置DataSource:
menuList = [
[menuPingTest,menuPortForword,menuDhcpRes],
[menuDataTraffic]
]
配置表:
func initView() {
advancedTable.dataSource = self
advancedTable.delegate = self
advancedTable.backgroundColor = uiStyleUtil.getBackGroundGrayColor()
advancedTable.tableFooterView = UIView.init(frame: CGRect.zero) //不显示无数据的空行
advancedTable.separatorColor = uiStyleUtil.getTableLineGrayColor()
}
section基本:
//Section
func numberOfSections(in tableView: UITableView) -> Int {
r

本文介绍了如何在iOS开发中自定义UITableView的section样式。内容包括配置无标题section,通过DataSource设置表结构,以及自定义section的两种方法。在使用grouped样式时,section的背景色和分割线样式受限,而选择plain样式则可以进行更多自定义,如设置背景色和字体颜色。同时,文章提到了通过header view和footer view实现section分割线的方法。
最低0.47元/天 解锁文章
983

被折叠的 条评论
为什么被折叠?



