feat:iOS Slider paging effect
This commit is contained in:
parent
f2d2c96619
commit
27db7f45fb
@ -70,6 +70,7 @@ - (UICollectionView *)build {
|
||||
collectionViewLayout:flowLayout]
|
||||
also:^(UICollectionView *it) {
|
||||
it.backgroundColor = [UIColor whiteColor];
|
||||
it.pagingEnabled = YES;
|
||||
it.delegate = self;
|
||||
it.dataSource = self;
|
||||
[it registerClass:[DoricCollectionViewCell class] forCellWithReuseIdentifier:@"doricCell"];
|
||||
@ -181,4 +182,9 @@ - (void)blendSubNode:(NSDictionary *)subModel {
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
|
||||
NSUInteger pageIndex = (NSUInteger) (scrollView.contentOffset.x / scrollView.width);
|
||||
scrollView.contentOffset = CGPointMake(pageIndex * scrollView.width, scrollView.contentOffset.y);
|
||||
}
|
||||
@end
|
||||
|
Reference in New Issue
Block a user