swift语言学习之UITableView分割线左边到头的解决

此方法兼容ios 7.8.9

    // 在tableView创建地方设置

   if tableView!.respondsToSelector("setSeparatorInset:"){

            tableView!.separatorInset = UIEdgeInsetsZero

        }

        if tableView!.respondsToSelector("setLayoutMargins:"){

            tableView!.layoutMargins = UIEdgeInsetsZero

        }

        self.tableView!.tableFooterView = UIView()  //去除空白的cell

  //在cell重用的方法里

        if cell.respondsToSelector("setSeparatorInset:"){

            cell.separatorInset = UIEdgeInsetsZero

        }

        

        if cell.respondsToSelector("setLayoutMargins:"){

            cell.layoutMargins = UIEdgeInsetsZero

        }

原文地址:https://www.cnblogs.com/muyushifang07/p/4587911.html