设置最后一个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];
         * }
         * 不一定需要写此注释里的语句
         */
    }
}
上一篇 下一篇

猜你喜欢

热点阅读