美文网首页
设置最后一个cell的分割线宽度

设置最后一个cell的分割线宽度

作者: 213dfddbef5e | 来源:发表于2017-02-26 22:54 被阅读23次
// 设置最后一个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];
         * }
         * 不一定需要写此注释里的语句
         */
    }
}

相关文章

网友评论

      本文标题:设置最后一个cell的分割线宽度

      本文链接:https://www.haomeiwen.com/subject/pauawttx.html