How to create a toolbar between UITableView rows

前端 未结 6 1719
终归单人心
终归单人心 2020-12-12 09:05

I am interested on how tweetbot does the following:

\"Enter

I would like to cr

6条回答
  •  悲&欢浪女
    2020-12-12 10:05

    In tableView:didSelectRowAtIndexPath:, you remove the tool view from the last selected cell. If there is no such view, you create a new one. Then you add this view to the newly selected cell. Save the indexPath of the selected row.

    In tableView:heightForRowAtIndexPath:, you check if the indexPath is the same as the saved indexPath. If they are equal, you return a height that is the height of both views. If it is not equal, just return the height of the "real cell".

    Put all your calls in didSelectRowAtIndexPath between [tableView beginUpdates] and [tableView endUpdates] to get animation for the height change.

提交回复
热议问题