Is it possible to programmatically show the red delete button on a UITableViewCell?

后端 未结 4 1947
傲寒
傲寒 2020-12-29 21:41

There are lots of similar questions on here, but none that I think specifically ask this question, which is, is there any way in code to force the red delete button to appea

4条回答
  •  死守一世寂寞
    2020-12-29 22:08

    By calling

    [self.tableView setEditing:YES animated:YES];
    

    on a UITableViewController you can set the tableView to editing mode. you can actually add a gesture recognizer to the cell a cell view that makes that call using a delegate method.

    According to the Documentation of UITableViewCell you can actually set the same way an individual cell. Apart from that you will have to manage the standard gesture recognizer. I guess subclassing would be your ally on that situation.

    I hope this helps.

提交回复
热议问题