apploft / ExpandableLabel

A simple UILabel subclass that shows a tappable link if the content doesn't fit the specified number of lines
MIT License
464 stars 126 forks source link

Behaves strange when used as the detailTextLabel #52

Open oscarlantz opened 6 years ago

oscarlantz commented 6 years ago

I have specified the detailTextLabel in a UITableViewCell to be an ExpandableLabel. The layout of the expandable label is not working very well. When the table is first loaded it shows only a few characters of the label text and no "...More" link. When scrolling down a little so the cell is no longer visible and then scrolling back up the expandable label is shown correctly. I'm pulling my hair out to figure out how I can trigger the expandable label to do its layout correctly the first time. It can also act strange... sometimes putting the ...More link too early in the text. And then after scrolling a few times more it can all of a sudden be correct again. I'm calling cell.layoutIfNeeded() after the text is set but it doesn't help.