IOS tableview 消除 分割线短 15 像素 ios8方法 swift版
系统默认样式:
ios8 去除默认分割线边距的代码:
//去除表格左侧分割线代码开始
func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
//ios8
if cell.respondsToSelector("setSeparatorInset:"){
cell.separatorInset = UIEdgeInsetsZero
tableView.separatorInset = UIEdgeInsetsZero
//cell.separatorInset.left = 5
}
if cell.respondsToSelector("setLayoutMargins:"){
cell.layoutMargins = UIEdgeInsetsZero
tableView.layoutMargins = UIEdgeInsetsZero
//cell.separatorInset.left = 5
}
}
//
本文欢迎转载,转载请注明出处,如果涉及侵权,请企鹅:723887809。

浙公网安备 33010602011771号