[ASDisplayNode] Stop infinite layout in _u_measureNodeWithBoundsIfNecessary#1434
Merged
nguyenhuy merged 1 commit intoTextureGroup:masterfrom Apr 1, 2019
Merged
[ASDisplayNode] Stop infinite layout in _u_measureNodeWithBoundsIfNecessary#1434nguyenhuy merged 1 commit intoTextureGroup:masterfrom
nguyenhuy merged 1 commit intoTextureGroup:masterfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We came across an infinite layout loop in
_u_measureNodeWithBoundsIfNecessary. After requesting a layout from above, the sizes between pending and caluclated layout still do not match. We continue to prefer to use the pending layout and ask for another layout loop from above. We can’t seem to break out of this loop. The solution (thanks to Huy for the guidance) was to nil out the pending layout we get from requesting the layout from above.I was only able to reproduce this when working with a node in a
UINavigationBarItem’stitleView. I think that UIKit must be doing something sneaky with setting the frame on the view. While I was not able to create a unit test to catch this issue (I tried for a long time, and can post what I’ve come up with to see if anyone has any suggestions), I was able to create a pretty simple example project that shows the behavior:https://github.com/rcancro/TextureLayoutLoopExample