设置最后一个cell的分割线宽度
2017-02-26 本文已影响23人
213dfddbef5e
// 设置最后一个cell分割线的宽度是横屏宽
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row == [self.clocklist_Array count] - 1) {
// 如果是最后一个,不偏移
if ([cell respondsToSelector:@selector(setSeparatorInset:)]){
[cell setSeparatorInset:UIEdgeInsetsZero];
}
/**
* if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
* [cell setLayoutMargins:UIEdgeInsetsZero];
* }
* 不一定需要写此注释里的语句
*/
}
}
![](https://img.haomeiwen.com/i1916415/57a27362b52d16b7.png)