forked from ZanderDev/PageCollectionViewLayout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PageCollectionViewLayout.h
52 lines (40 loc) · 1.42 KB
/
PageCollectionViewLayout.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// PageCollectionViewLayout.h
// Fashion
//
// Created by Alpha on 2018/8/4.
// Copyright © 2018年 Alpha. All rights reserved.
//
#import <UIKit/UIKit.h>
/**
横向滑动,横向分页展示数据
*/
@interface PageCollectionViewLayout : UICollectionViewLayout
@property (nonatomic) CGFloat minimumLineSpacing; //行间距
@property (nonatomic) CGFloat minimumInteritemSpacing; //item间距
@property (nonatomic) CGSize itemSize; //item大小
@property (nonatomic) UIEdgeInsets sectionInset;
- (instancetype)init;
@end
//let layout = PageCollectionViewLayout()
//layout?.itemSize = CGSize(width: 94.0/2, height: 94.0/2)
//layout?.sectionInset = UIEdgeInsetsMake(2, 10, 4, 10)
//layout?.minimumLineSpacing = 0
//layout?.minimumInteritemSpacing = 0
//
//guard let viewLayout = layout else {
// return
//}
//
//let collectionV = UICollectionView(frame: CGRect(x: 0, y: 0, width: screenWidth, height: 105), collectionViewLayout:viewLayout)
//collectionV.delegate = self
//collectionV.dataSource = self
//collectionV.isPagingEnabled = true
//collectionV.bounces = true
//collectionV.alwaysBounceHorizontal = true
//collectionV.showsHorizontalScrollIndicator = false
//collectionV.showsVerticalScrollIndicator = false
//collectionV.register(UINib.init(nibName: "CellName", bundle: nil), forCellWithReuseIdentifier: "CellName")
//collectionV.backgroundColor = UIColor.white
//collection = collectionV
//self.addSubview(collectionV)