- 首先在ViewDidLoad 或者ViewWillAppear里边写
1 if ([_tabView respondsToSelector:@selector(setSeparatorInset:)]) { 2 3 [_tabView setSeparatorInset:UIEdgeInsetsZero]; 4 5 } 6 if ([_tabView respondsToSelector:@selector(setLayoutMargins:)]) { 7 8 [_tabView setLayoutMargins:UIEdgeInsetsZero]; 9 10 }
- 然后在cellForRowIndexPath或者是Display里边加上
1 - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{ 2 3 4 if ([cell respondsToSelector:@selector(setSeparatorInset:)]) { 5 6 [cell setSeparatorInset:UIEdgeInsetsZero]; 7 8 } 9 10 if ([cell respondsToSelector:@selector(setLayoutMargins:)]) { 11 12 [cell setLayoutMargins:UIEdgeInsetsZero]; 13 } 14 15 16 17 18 }
之后 cell 下边的 线条就可以顶格了
时间: 2024-10-08 04:09:20