您的位置:首页 > 其它

tableview分割线显示不全

2016-03-29 10:07 381 查看
在viewdidload中

if tableview!.respondsToSelector("setSeparatorInset:"){
tableview?.separatorInset = UIEdgeInsetsZero
}
if tableview!.respondsToSelector("setLayoutMargins:"){
tableview?.layoutMargins = UIEdgeInsetsZero
}

重写
func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
if cell.respondsToSelector("setLayoutMargins:"){
cell.layoutMargins = UIEdgeInsetsZero
}
if cell.respondsToSelector("setSeparatorInset:"){
cell.separatorInset = UIEdgeInsetsZero
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: