第一个cell 遮挡 tabView 效果

1.设置一个空的uiview

 UIView * view = [[UIView alloc] init];
    
    view.backgroundColor = [UIColor clearColor];
    
    self.tableView.tableHeaderView = view;
    
    self.tableView.tableHeaderView.height = 75;
    
    [self.tableView addSubview:self.bottomImageView];

2.移动view 到底部

-(void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if([indexPath row] == ((NSIndexPath*)[[tableView indexPathsForVisibleRows] lastObject]).row){
        dispatch_async(dispatch_get_main_queue(),^{
            
            if (indexPath.section==0) {
                [tableView sendSubviewToBack:self.bottomImageView];
                [tableView.tableHeaderView removeFromSuperview];
            }
        });
    }
}

猜你喜欢

转载自blog.csdn.net/weixin_34313182/article/details/87577765