I have UITableViewCell
that consists button, label, collection view and view. At first it should return only button and label, but after clicking on button it should change its height to show view then when view is clicked it should show collection view with elements. Some ideas how to solve it?
Asked
Active
Viewed 310 times
-2

Lal Krishna
- 15,485
- 6
- 64
- 84
-
What have you tried so far? – d4Rk Dec 26 '18 at 11:05
-
I ve tried to check btn action in uitableviewcell then go to method where I ve tried to reload tableview by changing its height in heightForRowAt – Shakhzod Bobokhonov Dec 26 '18 at 11:09
1 Answers
1
Enter the views you want to show/hide on button click inside the stack-view and hide those views initially.
Get the indexPath of the cell when the button is clicked. Reference:get indexPath of UITableViewCell on click of Button from Cell
Set
isHidden
false
for the views where the button was clicked.Reload cell at that
indexPath
to view result.

Bista
- 7,869
- 3
- 27
- 55
-
1I found it useful. Still some problems, anyway it helped quite well. Thanks – Shakhzod Bobokhonov Dec 26 '18 at 12:00
-
-
Should I give constant height of the view that is inside the stack-view? – Shakhzod Bobokhonov Dec 26 '18 at 12:23
-
No, no need to give constant to view, simply hide the view, it will get removed automatically – Bista Dec 26 '18 at 12:42
-