swift tableview的分割线不能到头

1,设置tableview的separatorInset, layoutMargins

if(myTableView.respondsToSelector("setSeparatorInset:")) {
myTableView.separatorInset = UIEdgeInsetsMake(, , , )
}
if(myTableView.respondsToSelector("setLayoutMargins:")) {
myTableView.layoutMargins = UIEdgeInsetsMake(, , , )
}

2,设置cell的separatorInset, layoutMargins

    func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
if(cell.respondsToSelector("setSeparatorInset:")) {
cell.separatorInset = UIEdgeInsetsMake(, , , )
}
if(cell.respondsToSelector("setLayoutMargins:")) {
cell.layoutMargins = UIEdgeInsetsMake(, , , )
}
}
上一篇:♫【Git】


下一篇:科学计算软件——Octave安装