12345678910111213141516171819202122232425262728293031 |
- //
- // TeacherStyleFlowLayout.h
- // KulexiuForStudent
- //
- // Created by 王智 on 2022/8/30.
- //
- #import <UIKit/UIKit.h>
- NS_ASSUME_NONNULL_BEGIN
- @class TeacherStyleFlowLayout;
- @protocol WaterFlowLayoutDelegate <NSObject> //设置代理传递数据,降低了与其他类的耦合性,通用性更强
- - (CGFloat)waterFlowLayout:(TeacherStyleFlowLayout *)waterFlowLayout heightForWidth:(CGFloat)width andIndexPath:(NSIndexPath *)indexPath;
- @end
- @interface TeacherStyleFlowLayout : UICollectionViewFlowLayout
- @property (assign,nonatomic) CGFloat columnMargin;//每一列item之间的间距
- @property (assign,nonatomic) CGFloat rowMargin; //每一行item之间的间距
- @property (assign,nonatomic) NSInteger columnCount;//设置每一行排列的个数
- @property (weak,nonatomic) id<WaterFlowLayoutDelegate> delegate; //设置代理
- @end
- NS_ASSUME_NONNULL_END
|