ios - How to refresh a View added on tableViewCell (not refresh the entire cell)
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-06-15 09:23:52
0
3
1119

The question is as shown in the title.

Scenario: The current tableviewcell is spliced ​​from three views and added to cell.contentView. When refreshing, I only need to refresh the content in one view of one of the cells.
But when the refresh cell method is executed, the three views are refreshed together, causing the view with unchanged data to flash.
How can you optimize this scenario?

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(3)
刘奇

If you use self.tableView reloadRowsAtIndexPaths: withRowAnimation:The refresh will flash, consider whether the layout has changed, check layoutSubviews, or re-create the view. This view is relatively expensive, optimize FPS and cache cell height

某草草

It is called reloadRowsAtIndexPaths to achieve refresh. When layoutSubviews is called during refresh, the layout does not change. I set the view layout initially, and refresh the value of the control passed in the model.
Asynchronous rendering has been optimized, and the height of each cell is fixed.

曾经蜡笔没有小新

You have to control it through the data source. Don’t think about the view alone. Data is related to the reuse of cells

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template