// // RQVipAlertHeaderCollectionReusableView.m // jiaPei // // Created by 张嵘 on 2022/3/4. // Copyright © 2022 JCZ. All rights reserved. // #import "RQVipAlertHeaderCollectionReusableView.h" @interface RQVipAlertHeaderCollectionReusableView () @property (weak, nonatomic) IBOutlet UIImageView *myBgImageView; @property (nonatomic, readwrite, strong) RQVipAlertHeaderGroupViewModel *viewModel; @end @implementation RQVipAlertHeaderCollectionReusableView + (instancetype)reusableViewWithCollectionView:(UICollectionView *)collectionView OfKind:(NSString *)elementKind forIndexPath:(NSIndexPath *)indexPath { NSString *ID = [NSString stringWithFormat:@"%@%@", @"RQVipAlertHeaderCollectionReusableView",elementKind]; [collectionView registerNib:[UINib nibWithNibName:@"RQVipAlertHeaderCollectionReusableView" bundle:nil] forSupplementaryViewOfKind:elementKind withReuseIdentifier:ID]; RQVipAlertHeaderCollectionReusableView *reusableView = [collectionView dequeueReusableSupplementaryViewOfKind:elementKind withReuseIdentifier:ID forIndexPath:indexPath]; if (!reusableView) reusableView = [self rq_viewFromXib]; return reusableView; } - (void)bindViewModel:(RQVipAlertHeaderGroupViewModel *)viewModel { _viewModel = viewModel; } - (void)awakeFromNib { [super awakeFromNib]; // Initialization code [_myBgImageView setImage:[UIImage imageWithGradualChangingColor:^(QQGradualChangingColor *graColor) { graColor.fromColor = [UIColor qmui_colorWithHexString:@"#FFFFFF"]; graColor.toColor = [UIColor qmui_colorWithHexString:@"#FEEEDF"]; graColor.type = QQGradualChangeTypeLeftToRight; } size:CGSizeMake(RQ_SCREEN_WIDTH, 57) cornerRadius:QQRadiusZero]]; } @end