0

I'm changing an existing project to AsyncDisplayKit/Texture. I just got to the last part of my new ASTableNode, where I've encountered a bug. In my ASTableNode, there's a ASTextNode. Now after I receive a notification I try to change the AttributedText of said ASTextNode, but when I do this, it makes the parent node flash. (See GIF here:)

enter image description here

Is there an explanation for this? The AttributedText is changed like this:

self.likes.countLabel.attributedString = NSMutableAttributedString(string: "\(newCount)", attributes: self.likes.font)

Is this perhaps a threading issue, or has anyone else faced a bug like this before?

Thanks.

sushibrain
  • 2,712
  • 5
  • 33
  • 62
  • need a simple example project with it issue. This can be associated with a hierarchy of conversion calls. Try to play with `[self.likes.countLabel setNeedsLayout];` method after setup new attributedString. – Bimawa May 14 '18 at 15:06
  • 1
    its because changing text node width causes the entire cell gets relayout. set a break point in your cell layout spec block and see it gets relayout or not. – Hashem Aboonajmi May 15 '18 at 07:50
  • @HashemAboonajmi Yep, you're right. Any way to prevent this? – sushibrain May 15 '18 at 07:54
  • @WesleyPeeters Separate the cells and start working with sections instead of cells. – Leon May 15 '18 at 11:25
  • modify your layout spec, create a sub node named `ActionBarNode` and define those buttons there with there specific layout, then add this sub node in the cell, see the result. – Hashem Aboonajmi May 15 '18 at 16:34

0 Answers0