UITableView
#pragma mark - 設(shè)置分割線為屏幕寬度
-(void)viewDidLayoutSubviews{
[super viewDidLayoutSubviews];
if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {
[self.tableView setSeparatorInset:UIEdgeInsetsZero];
}
if ([self.tableView respondsToSelector:@selector(setLayoutMargins:)]) {
[self.tableView setLayoutMargins:UIEdgeInsetsZero];
}
}
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
cell.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);
}
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
cell.layoutMargins = UIEdgeInsetsZero;
}
}
側(cè)滑返回執(zhí)行協(xié)議方法
- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
if (![self.navigationController.viewControllers containsObject:self])//等效[self.navigationController.viewControllers indexOfObject:self] == NSNotFound
{
//自定義實現(xiàn)協(xié)議方法
// [self executeDelegateMethods];
}
}
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者