首页 > 技术文章 > 视频课左右滑动后应该定位

tufei7 2019-01-02 15:07 原文

tableView headerView复用问题

应该跟cell一样,先注册,再dequeue

在 viewForHeaderInSection:(NSInteger)section {

这个方法里面dequeue  :

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    
    GRHeaderView *headerView = [tableView dequeueReusableHeaderFooterViewWithIdentifier:@"GRHeaderView"];
    headerView.delegate = self;
    [headerView configArray:self.units];
    return headerView;
}

 

推荐阅读