Skip to content

Commit

Permalink
fix(ios): add missing alwaysBounceVertical for ListView
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwcg authored and hippy-actions[bot] committed Oct 31, 2023
1 parent 6c7e5fa commit e121aed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,13 @@ - (void)setHorizontal:(BOOL)horizontal {
UICollectionViewFlowLayout *layout = (UICollectionViewFlowLayout *)self.collectionView.collectionViewLayout;
layout.scrollDirection = horizontal ? UICollectionViewScrollDirectionHorizontal : UICollectionViewScrollDirectionVertical;
[self.collectionView.collectionViewLayout invalidateLayout];
if (horizontal) {
[self.collectionView setAlwaysBounceHorizontal:YES];
[self.collectionView setAlwaysBounceVertical:NO];
} else {
[self.collectionView setAlwaysBounceVertical:YES];
[self.collectionView setAlwaysBounceHorizontal:NO];
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ - (void)initCollectionView {
collectionView.dataSource = self;
collectionView.delegate = self;
collectionView.layoutDelegate = self;
collectionView.alwaysBounceVertical = YES;
collectionView.backgroundColor = [UIColor clearColor];
_collectionView = collectionView;
[self registerCells];
Expand Down

0 comments on commit e121aed

Please sign in to comment.