CollectionViewSpaceLayout.h 803 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // CollectionViewSpaceLayout.h
  3. // xiaoli
  4. //
  5. // Created by zjh on 16/9/27.
  6. // Copyright © 2016年 zjh. All rights reserved.
  7. // 使每个item等间距
  8. #import <UIKit/UIKit.h>
  9. @protocol SpaceLayoutDelegate <NSObject>
  10. @required
  11. //返回cell大小
  12. - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath;
  13. @end
  14. @interface CollectionViewSpaceLayout : UICollectionViewLayout
  15. @property (nonatomic,weak) id<SpaceLayoutDelegate> delegate;
  16. //距离上下左右的距离
  17. @property (nonatomic,assign) UIEdgeInsets sectionInsets;
  18. //上下两个item的距离
  19. @property (nonatomic,assign) CGFloat lineSpacing;
  20. //左右两个item的距离
  21. @property (nonatomic,assign) CGFloat interitemSpacing;
  22. @end