直接復(fù)制可用:
//TODO: 分割線頂頭
//實(shí)現(xiàn)方法
override func viewDidLayoutSubviews() {
self.tb!.separatorInset = UIEdgeInsets.zero
self.tb!.layoutMargins = UIEdgeInsets.zero
}
//回調(diào) cell回調(diào) 滾動屏幕cell將要顯示的時候調(diào)用
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
cell.separatorInset = UIEdgeInsets.zero
cell.layoutMargins = UIEdgeInsets.zero
}