Space Between Sections in UITableview

前端 未结 11 2197
醉酒成梦
醉酒成梦 2020-12-08 12:37

I need to reduce the space between two sections ofUITableView. I looked at this question but the solution doesn\'t allow for my custom header view because it c

11条回答
  •  余生分开走
    2020-12-08 13:37

    For Swift 4+ you need to implement these two methods

    extension MyViewController : UITableViewDelegate {
    
        func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
            return CGFloat.leastNormalMagnitude
        }
    
        func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
            return UIView()
        }
    
    }
    

提交回复
热议问题