根据传入的一个字典和视图参数初始化一个collectionView,你只要把你想创建生成的collectionView需要的参数通过一个方法传入,并通过点击事件产生下拉,就可得到collectionView,并能通过点击确定返回你所选的item。
初始化:
self.flowView = [[FlowView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight)];
- (void)setCollectionViewWithModel:(NSDictionary *)model
collectionViewOriginY:(CGFloat)originY
lineCount:(int)lineCount
itemHeight:(CGFloat)itemHeight
itemDistance:(CGFloat)itemDistance
itemCornerRadius:(CGFloat)itemCornerRadius
itemBorderWidth:(CGFloat)itemBorderWidth
itemTextFontSize:(CGFloat)fontSize
itemBorderColor:(UIColor *)itemBorderColor
itemTextColor:(UIColor *)itemTextColor
selectedColor:(UIColor *)itemSelectedColor
unselectedColor:(UIColor *)itemUnselectedColor
headerViewHeight:(CGFloat)headerViewHeight
footerViewHeight:(CGFloat)footerViewHeight
certainBtnHeight:(CGFloat)certainBtnHeight
certainBtnBackgroundColor:(UIColor *)certainBtnBackgroundColor
certainBtnTextLabelColor:(UIColor *)certainBtnTextLabelColor;
点击事件,让flowView下拉展示
- (IBAction)click:(id)sender{
[self.flowView pushDown];
}
通过选择返回的item组成的数组,由数组组成
[self.flowView setReturnSelected:^(NSMutableArray *array) {
NSLog(@"%@",array);
}];
网友评论