UITableView Custom Cells Disappearing content after Scrolling

前端 未结 10 1171
滥情空心
滥情空心 2020-12-17 00:12

I have seen this being asked here many times but none of the solutions worked for me. Here is my code snippet:

- (UITableViewCell *)tableView:(UITableView *)         


        
10条回答
  •  渐次进展
    2020-12-17 00:31

    You need to calculate the correct height for each cells according to its content.

    This can be done in the UITableView delegate method:

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
           CGFloat height;
           //Calculate height for each cell
           return height;
    }
    

提交回复
热议问题