-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
ASDisplayNode+UIViewBridge.mm
ASBinder setNeedsLayout sometime called before ASCellNode loaded
- (void)layoutIfNeeded
{
BOOL shouldApply = NO;
BOOL loaded = NO;
id viewOrLayer = nil;
{
_bridge_prologue_write;
shouldApply = ASDisplayNodeShouldApplyBridgedWriteToView(self);
loaded = __loaded(self);
viewOrLayer = _view ?: _layer;
if (shouldApply == NO && loaded) {
// The node is loaded but we're not on main.
// We will call layoutIfNeeded on the view or layer when we apply the pending state. __layout will in turn be called on us (see -[_ASDisplayLayer layoutSublayers]).
// We need to call it on main if the node is loaded to support automatic subnode management.
// We can't release the lock before applying to pending state, or it may be flushed before it can be applied.
[ASDisplayNodeGetPendingState(self) layoutIfNeeded];
}
}
if (shouldApply) {
// The node is loaded and we're on main.
// Message the view or layer which in turn will call __layout on us (see -[_ASDisplayLayer layoutSublayers]).
[viewOrLayer layoutIfNeeded];
} else if (loaded == NO) {
// The node is not loaded and we're not on main.
[self __layout];
}
}In this case, ASCellNode constrainedSize can't change no more
Metadata
Metadata
Assignees
Labels
No labels