https://github.com/czl0325/zlscrollbuttonsview
图标列表的滚动视图
https://github.com/czl0325/zlscrollbuttonsview
Last synced: 3 months ago
JSON representation
图标列表的滚动视图
- Host: GitHub
- URL: https://github.com/czl0325/zlscrollbuttonsview
- Owner: czl0325
- License: apache-2.0
- Created: 2017-11-03T08:24:11.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-28T01:59:40.000Z (over 7 years ago)
- Last Synced: 2025-01-22T16:47:27.316Z (5 months ago)
- Language: Objective-C
- Size: 602 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ZLScrollButtonsView
图标列表的滚动视图模仿苹果手机屏幕上app图标的拖动,切换页面。demo还不完善(如果有朋友有优化的方法,可以交流)

用法如下:
详见demo
代码如下:
```Objective-C
- (UICollectionView *)myCollectionView{
if (!_myCollectionView) {
ZLHorizontalFlowLayout *viewFlowLayout = [[ZLHorizontalFlowLayout alloc] init];
viewFlowLayout.delegate = self;
viewFlowLayout.minimumLineSpacing = 5;
viewFlowLayout.minimumInteritemSpacing = 5;
viewFlowLayout.sectionInset = UIEdgeInsetsMake(3, 3, 3, 3);
_myCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:viewFlowLayout];
_myCollectionView.showsHorizontalScrollIndicator = NO; // 去掉滚动条
_myCollectionView.backgroundColor = [UIColor whiteColor];
_myCollectionView.alwaysBounceHorizontal = YES;
_myCollectionView.pagingEnabled = YES;
_myCollectionView.delegate = self;
_myCollectionView.dataSource = self;
[_myCollectionView registerClass:[MyCell class] forCellWithReuseIdentifier:@"MyCell"];
//[_myCollectionView registerClass:[CustomCollectionViewCell class] forCellWithReuseIdentifier:identifier];
}
return _myCollectionView;
}
```