0

I have a tableview which has different kind of cells. One of the prototypes cells should contain some datafrom a webpage:

Originally I only have the webpage url.

Cell should contain: Image (webpage main image), Title (webpage title), Description (webpage description). Like whatsapp link sharing works more or less

So first I'm loading the cell, in cellForRowAtIndexPath I assign the corresponding prototype cell to that cell and the prototype cell has a customView in which I have a method called: loadUrlContent to which I pass the url and in an async request it returns the image url, title and description. later on the main thread I'm loading the strings to the customView.

The tableView has UITableViewAutomaticDimension and estimatedRowHeight settled.

For some reason the cell is not resizing after I load the elements in the customView, I'm able to see all the customView and the subviews I have settled but the cell is not resizing so I have cells overlapping

load tableView and cell -> download url -> update content to customView (customView is inside the cell)

  • 1
    If the cell is displayed and then it's height changes, you need to tell the tableview to reload that cell otherwise it won't know that the height is different. – Craig Siemens Nov 24 '16 at 21:18
  • 1
    you may check the title and description label width x height with the help of these: http://stackoverflow.com/questions/1340667/pixel-width-of-the-text-in-a-uilabel and then dynamically set the row height which is possible via http://stackoverflow.com/questions/37890804/set-tableview-cell-row-height-dynamically and then make the image fit-to-aspect and full height of the row. – JSBach Nov 24 '16 at 23:39

0 Answers0