how do I expand cell in tableview dynamically?

后端 未结 3 1420
醉话见心
醉话见心 2021-01-25 22:28

I have only one cell with a button in a tableview. The cell height is defined in

tableView:tableView:heightForRowAtIndexPa         


        
3条回答
  •  囚心锁ツ
    2021-01-25 22:53

    When the button is pressed you should set a variable to a value that indicates it has been pressed, then call reloadData on your tableView. This will make tableView:heightForRowAtIndexPath to be called again.

    In tableView:heightForRowAtIndexPath check the variable that tells you if the button has been pressed or not and return 80 if it has been pressed

提交回复
热议问题