UITableView : crash when adding a section footer view in empty section

后端 未结 5 609
滥情空心
滥情空心 2020-12-10 13:42

This is the first time I ask a question here, but I have to say this site has been a tremendous help for me over the last couple months (iphone-dev-wise), and I thank you fo

5条回答
  •  独厮守ぢ
    2020-12-10 14:41

    • make empty section
    • use table header in this section instead of footer in first section
    - (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
        if (section != OTHER_SECTION_INDEX) {
            return nil;
        }
        //your code here
    }
    
    - (CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
    {
        if (section != OTHER_SECTION_INDEX) {
            return 0;
        }
        //your code
    }
    

提交回复
热议问题