Preload cells of uitableview

前端 未结 5 1153
逝去的感伤
逝去的感伤 2021-02-20 15:10

I acknowledge that UITableview load dynamically a cell when user scrolls. I wonder if there is a way to preload all cells in order not to load each one while scrolling. I need t

5条回答
  •  深忆病人
    2021-02-20 15:43

    Solution for autoresizing cells. Change 'estimatedRowHeight' to lower value

    - (void)viewDidLoad {
        [super viewDidLoad];
        self.tableView.rowHeight = UITableViewAutomaticDimension;
        self.tableView.estimatedRowHeight = 32; //Actual is 64
    }
    

    Actual estimated height is 64. 32 is used to add more cells for reuse to avoid lagging when scrolling begins

提交回复
热议问题