Texture icon indicating copy to clipboard operation
Texture copied to clipboard

reloadRowsAtIndexPaths keep flashing

Open tomtao2022 opened this issue 1 year ago • 2 comments

for index in 0..<100 { tableNode?.reloadRows(at: [IndexPath(row: index, section: 0)], with: .none) }

The table cell will keep flashing, is there any way to solve it?

  • (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation

tomtao2022 avatar Jun 03 '23 07:06 tomtao2022

try to use neverShowPlaceholders in your ASCellNode

neverShowPlaceholders = true

berbaspin avatar Jul 31 '23 05:07 berbaspin

You can manually update the layout of the cell without having to reload it.

// put this code in your view controller or where you need to call the update function

myCell.update(with: something)

// put this function inside your cell

class MyCell: ASCellNode { func update(with item: ItemType) { // update your cell's model data and subnodes // ... // when you're done, call this function: transitionLayout(withAnimation: false, shouldMeasureAsync: false, measurementCompletion: nil) } }

abbasnaqvi200 avatar Aug 14 '23 05:08 abbasnaqvi200