-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using NSTextAttachment image in the attributed text of a ASTextNode, how to reload the ASTextNode? #2097
Comments
I figured out the solution myself. Basically, first I set the Here's the full demo code:
|
I am able to demonstrate my issue with this simple example.
I have a
ASTableNode
which shows attributed strings. These will have images in them viaNSTextAttachment
. These images will be from URLs which will be downloaded asynchronously. In this example, for simplicity, I am just using an image from theBundle
. Once downloaded, theNSTextAttachment
needs to update its bounds to the correct aspect ratio of the actual image.The problem I am facing is that despite me calling
setNeedsLayout()
andlayoutIfNeeded()
after updating the image and bounds of the NSTextAttachment after getting the image, theASTextNode
never updates to show the image. I am not sure what I am missing.Code:
The text was updated successfully, but these errors were encountered: