Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Some problems with ASTableNode #3294

Open
ghost opened this issue Sep 21, 2017 · 1 comment
Open

Some problems with ASTableNode #3294

ghost opened this issue Sep 21, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 21, 2017

I implement the ASTableNode with cell contains html. I'm using a third-party UIView wrapped in a ASDisplayNode to display HTML(sometimes html is big and contains a lot of image). So sometime it requires a long calculation/drawing. This is awesome but I can see some problems with the library. I'm really appreciate if you can help me identified some problems?

  1. During debug I see the table calculate the first cell size lastly. So is there any way to calculate first cell size firstly? Because next cells could be big and long drawing, and it takes a long time to display the table.

This is the debug text, showed cell 4 will calculated and layout first

"Cell [0, 4] - ratio 0.131707317073171"
"Cell [0, 4] - ratio 0.131707317073171"
"Cell [0, 3] - ratio 0.131707317073171"
"Cell [0, 3] - ratio 0.131707317073171"
"Cell [0, 2] - ratio 0.214634146341463"
"Cell [0, 2] - ratio 0.214634146341463"
"Cell [0, 1] - ratio 0.131707317073171"
"Cell [0, 1] - ratio 0.131707317073171"
"Cell [0, 0] - ratio 3.28780487804878"
"Cell [0, 0] - ratio 3.28780487804878"
"Cell [0, 0] - ratio 3.28780487804878"
"Cell [0, 0] - ratio 3.28780487804878"

  1. One more problem I could see the table cell did not display the wrapped UIView correctly. Some cells with short text will show the vertical lines. After scroll up and down, the cell is normal again.

Screenshot

3 . And when the wrapped UIView in ASDisplayNode changes the size, the wrapper ASDisplayNode does know about this and does not change at all. Is there any way for the wrapper node know it's UIView size change?

My wrapper UIView code:

textContentNode = ASDisplayNode { [unowned self] () -> UIView in let textView = MyCustomHtmlView() textView.attributedString = attrHtml textView.delegate = self textView.edgeInsets = self.insets return textView }

During the delegate for update images (I was using ASNetworkImage), if the image downloaded completely, I update the textView and no way the textContentNode changes the size (I called setNeedLayout ...)

@ghost ghost changed the title ASTableNode calculate the first cell size last, is this true? Some problems with ASTableNode Sep 22, 2017
@ay8s
Copy link
Contributor

ay8s commented Sep 27, 2017

Please update to use Texture and ask any questions over in the Texture repository. https://github.com/texturegroup/texture

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant