Skip to content

Commit 7533118

Browse files
committed
Fix unnecessary relayout if table view width is zero initially
- During initial configuration of a table view with a zero size, for each cell, there is a mismatch between the widths of its content view and constrained size. However, don't relayout the cell immediately because an initial data loading will be performed shortly afterward.
1 parent 52a259a commit 7533118

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

AsyncDisplayKit/ASTableView.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ - (void)willLayoutSubviewsOfTableViewCell:(_ASTableViewCell *)tableViewCell
880880
// Normally the content view width equals to the constrained size width (which equals to the table view width).
881881
// If there is a mismatch between these values, for example after the table view entered or left editing mode,
882882
// content view width is preferred and used to re-measure the cell node.
883-
if (contentViewWidth != constrainedSize.max.width) {
883+
if (!_ignoreNodesConstrainedWidthChange && contentViewWidth != constrainedSize.max.width) {
884884
constrainedSize.min.width = contentViewWidth;
885885
constrainedSize.max.width = contentViewWidth;
886886

0 commit comments

Comments
 (0)