标签:
1,设置tableview的separatorInset, layoutMargins
if(myTableView.respondsToSelector("setSeparatorInset:")) { myTableView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0) } if(myTableView.respondsToSelector("setLayoutMargins:")) { myTableView.layoutMargins = UIEdgeInsetsMake(0, 0, 0, 0) }
2,设置cell的separatorInset, layoutMargins
func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) { if(cell.respondsToSelector("setSeparatorInset:")) { cell.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0) } if(cell.respondsToSelector("setLayoutMargins:")) { cell.layoutMargins = UIEdgeInsetsMake(0, 0, 0, 0) } }
标签:
原文地址:http://www.cnblogs.com/shidaying/p/4829516.html