且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在表视图中调整行大小的***方法是什么?

更新时间:2022-11-11 19:19:35

您应该按照以下步骤操作:

You should follow these steps:

  1. 为 tableview 设置 UITableViewAutomaticDimension
  2. 将图像视图的自动布局约束设置为单元格的顶部和底部,以便单元格将其高度自动调整为图像视图的高度.

  1. Set UITableViewAutomaticDimension for the tableview
  2. Set auto layout constraints for the image view to the top and bottom of the cell so that the cell will automatically adjust its height to the height of the image view.

由于您已下载图像,因此您应该在图像下载完成后重新加载重新加载单元(如果您可以分享用于下载图像的代码,我将能够对此进行更多解释).>

Since you are images are downloaded you should reload reload cell on the completion of the image download (I will be able to explain more on this if you can share the code you use to download the images).