I created a custom expandable UITableCellView. The top label of the cell can't be seen,when ever I click on the cell,It will be expanded and show all the labels on the cell. And also I got some errors in "Output" that are about breaking constraints and unwanted constraints.
Asked
Active
Viewed 58 times
0
-
Refer this link:-https://github.com/Ramotion/folding-cell, the mentioned library is easy to implement and fits your requirement. – Meet Jul 31 '16 at 14:18
1 Answers
0
This is not the exact solution, but can be a possible solution. Possibly provide the labels with zero width or zero height, whenever you are expanding the TableViewCell(I am expecting that you are doing it by code), provide the labels with proper size you require and change them accordingly when you are changing the size of TableViewCell. Solution can be more exact if you provide some more information.
Coming on to breaking of constraints part, it is quite clear from the constraint given by you, that some constraint (in my opinion label size i.e. width and height) are just not getting satisfied. So, you have to provide that properly. This might fix your problem.

Sanchit Kumar Singh
- 513
- 1
- 5
- 17
-
Thanks a lot. I set width and height of labels to zero. But How I can change width and height by Swift? I search about It,but nothing good enough I found. – Behdad Jul 31 '16 at 17:24
-
This part is quite easy, just make outlets of your labels and provide them with the height and width i.e. `self.X.frame.size.height=desiredHeight`(I am assuming the name of your label is X). Similarly do for X height and set frame of Y too. You can see the answers in this [**link**](http://stackoverflow.com/questions/31228831/how-to-give-dynamic-height-to-uilabel-programatically-in-swift) to get further idea about how to set label frame programmatically. – Sanchit Kumar Singh Aug 01 '16 at 01:46