How to stop UITableView from returning to top cell after popover

后端 未结 4 1331
春和景丽
春和景丽 2021-01-24 13:47

I have a tableView full of images. When a user taps on an image (within the cell), a viewController with a larger zoomable version of the image is called with a popover segue. W

4条回答
  •  有刺的猬
    2021-01-24 14:13

    Cache selected indexPath of the selected image cell, and in viewWillAppear method,

        if(selectedPath != nil) {
            [self.tableView scrollToRowAtIndexPath:selectedPath atScrollPosition:UITableViewScrollPositionBottom animated:YES];
         }
    

    This will scroll back to your selected image row.

提交回复
热议问题