Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
* [iOS] try to fix the recycleList component introduced by #1105
Browse files Browse the repository at this point in the history
  • Loading branch information
acton393 committed Apr 20, 2018
1 parent d36a34c commit 7a8732b
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,20 @@ @implementation WXComponent (Layout)
- (void)setNeedsLayout
{
WXComponent *supercomponent = [self supercomponent];
if(supercomponent){
for (WXComponent *siblingComponent in [supercomponent subcomponents]) {
[siblingComponent _needRecalculateLayout];
}
if (self->_virtualComponentId || self->_templateComponent) {
// we will generate a virtualComponentId for recycleList virtual component or templateComponent for recycleList component template.
// as for recyclelist component, it depends on the input data, not the new layout, here will not try to clear slibling child layout.
_isLayoutDirty = YES;
[supercomponent setNeedsLayout];
} else {
[self _needRecalculateLayout];
if(supercomponent){
for (WXComponent *siblingComponent in [supercomponent subcomponents]) {
[siblingComponent _needRecalculateLayout];
}
[supercomponent setNeedsLayout];
} else {
[self _needRecalculateLayout];
}
}
}

Expand Down

0 comments on commit 7a8732b

Please sign in to comment.