Get tableView:heightForRowAtIndexPath: to happen after tableView:cellForRowAtIndexPath:?

前端 未结 3 687
無奈伤痛
無奈伤痛 2020-12-14 20:58

I\'ve got some UITableViewCells that need to change their height depending on the length of the strings inside. I\'m calculating the necessary height inside tableView:

3条回答
  •  伪装坚强ぢ
    2020-12-14 21:04

    You could just set self.numberOfLines to 0 once and it would work the same. (If numberOfLines is set to 0 then the label uses as many rows as are needed.)

提交回复
热议问题