简体   繁体   中英

Reload UITableViewCell without UITableView scrolling

I'm using a UISegmentedControl which changes the contents of a UITableViewCell . After the segment changes I need to reload the cell to update the height of it. I do this by calling:

[self.tableView reloadRowsAtIndexPaths:@[self.segmentIndexPath] withRowAnimation:UITableViewRowAnimationNone];

However, this makes the UITableView scroll to the top. What is the best way to do this without having the table scroll?

尝试使用[self.tableView visibleCells] ,然后找到此单元格并进行更改

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM