123456789101112131415161718192021222324252627282930 |
- //
- // UITableViewCell+RQExtension.m
- // XinShouJiaDao
- //
- // Created by 张嵘 on 2020/6/19.
- // Copyright © 2020 JCZ. All rights reserved.
- //
- #import "UITableViewCell+RQExtension.h"
- @implementation UITableViewCell (RQExtension)
- - (void)drawRect:(CGRect)rect {
- [super drawRect:rect];
- UITableView *superView = (UITableView *)self.superview;
- if (![superView isKindOfClass:[UITableView class]]) {
- superView = (UITableView *)self.superview.superview;
- }
-
- if ([superView isKindOfClass:[UITableView class]]) {
- NSIndexPath *indexPath = [superView indexPathForCell:self];
- NSInteger rows = [superView numberOfRowsInSection:indexPath.section];
- self.separatorInset = UIEdgeInsetsMake(0, 15, 0, 0);
- if(indexPath.row == rows -1) {
- self.separatorInset = UIEdgeInsetsMake(0, 0, 0, RQ_SCREEN_WIDTH);
- } else {
- self.separatorInset=UIEdgeInsetsMake(0, 15, 0, 0);
- }
- }
- }
- @end
|