How can I animate the dismissal of a UITableView swipe-to-delete button?

后端 未结 3 676
醉梦人生
醉梦人生 2021-02-13 17:03

As is done in the iPhone Mail app, I would like have the \"Delete\" button which appears on swiping an editable table cell from right to left to animate when it is dism

3条回答
  •  别那么骄傲
    2021-02-13 17:51

    You should not need to animate the dismissal manually, it works the same way as invoking it so not sure why it is behaving differently in your app.

    Are you using custom cells by any chance? As a thought for you to try, change the shouldIndentWhileEditingRowAtIndexPath: method to return NO and see if it changes anything. The only thing I can think of is that your content indentation is interfering with the delete button area in a way that the animation can't be performed or is not behaving as it should.

    - (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath { return NO; }

提交回复
热议问题