美文网首页
第一个cell 遮挡 tabView 效果

第一个cell 遮挡 tabView 效果

作者: 九月_adhoc | 来源:发表于2019-01-12 11:18 被阅读7次

    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];
                }
            });
        }
    }
    

    相关文章

      网友评论

          本文标题:第一个cell 遮挡 tabView 效果

          本文链接:https://www.haomeiwen.com/subject/vlwqdqtx.html