How to refresh UITableViewCell?

前端 未结 3 394
别跟我提以往
别跟我提以往 2021-02-03 13:01

I have a UITableView with a custom UITableViewCell. In cellForRowAtIndexPath, I assign a font to a label in every cell, since the user can change font size at any time. To cha

3条回答
  •  一整个雨季
    2021-02-03 13:34

    For the cells that are still there you have to update the font of the label. You'll need a way to access the custom label in your custom cell.

    After changing the font size do something like:

    for (MyCell* cell in [theTableView visibleCells]) {
        [cell.myLabel.font = newFont];
    }
    

提交回复
热议问题