Skip to content

Commit

Permalink
fix(ios): fix scroll view error when same subview inserted
Browse files Browse the repository at this point in the history
  • Loading branch information
ozonelmy authored and boxizen committed Aug 16, 2021
1 parent be6df52 commit c28a059
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ios/sdk/component/scrollview/HippyScrollView.m
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ - (void)setRemoveClippedSubviews:(__unused BOOL)removeClippedSubviews {
}

- (void)insertHippySubview:(UIView *)view atIndex:(NSInteger)atIndex {
if (view == _contentView && 0 == atIndex) {
return;
}
[super insertHippySubview:view atIndex:atIndex];
HippyAssert(_contentView == nil, @"HippyScrollView may only contain a single subview");
_contentView = view;
Expand Down

0 comments on commit c28a059

Please sign in to comment.