ios swift tableView insetGrouped 圆角 组间距

1.圆角

参考博客:
「iOS」UITableView.Style.insetGrouped样式 及 代码实现圆角cell 方案 - 知乎

2.组间距

    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
    
    
        0
    }
     
    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
    
    
        10
    }

要实现下面两个代理方法,上面的两个代理方法才会生效

    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
    
    
        nil
    }
    
    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
    
    
        nil
    }

猜你喜欢

转载自blog.csdn.net/baidu_40537062/article/details/129702088