How to deselect a selected UITableView cell?

前端 未结 24 3217
一整个雨季
一整个雨季 2020-12-07 10:10

I am working on a project on which I have to preselect a particular cell.

I can preselect a cell using -willDisplayCell, but I can\'t deselect it when t

24条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-07 10:24

    NSIndexPath * index = [self.menuTableView indexPathForSelectedRow];
    [self.menuTableView deselectRowAtIndexPath:index animated:NO];
    

    place this code according to your code and you will get your cell deselected.

提交回复
热议问题