ZYThumbnailTableView icon indicating copy to clipboard operation
ZYThumbnailTableView copied to clipboard

Clearer Description of how to Create Expandable Cells

Open tjw0051 opened this issue 8 years ago • 2 comments

I've just been using the ZY Thumbnail Table View and love what its capable of. One issue I was stuck on was designing custom table view cells that expanded correctly when clicked on.

I finally managed to get expanding table cells by ensuring the text label had 'Lines' set to 0, and Line Breaks set to 'Word Wrap'. In the hierarchy I had a single child view of the Content View which was pinned to the top, bottom, left and right of the superview. Inside the view were the child elements, including the text block I wanted to expand. Each of these child elements was separated by a vertical spacer. The last two elements were my expanding text label, and a 'dummy' image view (as shown in the Demo).

I thought it might be helpful to future users trying to make their table cells expand correctly, as I've spent a few hours trying to get it right.

tjw0051 avatar Aug 29 '16 22:08 tjw0051

is your problem with the incorrect height of UILabel calculated by system?

liuzhiyi1992 avatar Aug 30 '16 02:08 liuzhiyi1992

it is a bug of Apple, With all correct AutoLayout Constraint,we need calculate the height of UILabel by ourself with -boundingRectWithSize:option:attribute:context:

liuzhiyi1992 avatar Aug 30 '16 02:08 liuzhiyi1992