How to create padding(spacing) between rows in tablview

后端 未结 5 775
情深已故
情深已故 2020-12-15 12:21

This isn\'t a duplicate I read the other questions regarding this and none of them gave me what i needed , I\'m creating a table view with custom cell and the style is group

5条回答
  •  孤城傲影
    2020-12-15 12:43

    in swift 5.1 :

       override func numberOfSections(in tableView: UITableView) -> Int {
           return 2
       }
       override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
           return 1
       }
    
       override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
           return 15
       }
    
       override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
           return 30
       } 
    

提交回复
热议问题