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

后端 未结 3 677
醉梦人生
醉梦人生 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:43

    I had the same problem, just now found out that there is some problem when we have empty cell.textLabel.text. Try add in

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath:
    {
        {...} // omitted code
        cell.textLabel.text = @"whatever";          
        cell.textLabel.hidden = YES;
    }
    

    With this swipe button dismiss proper, but WHY? PS: tested with custom cells and built i.n

提交回复
热议问题