// // KBSignInView.m // YouHuiProject // // Created by 小花 on 2018/9/27. // Copyright © 2018年 kuxuan. All rights reserved. // #import "KBSignInView.h" #import "KBSignInModel.h" @interface KBSignInView () @property (nonatomic, strong) NSMutableArray *imgArray; @property (nonatomic, strong) NSMutableArray *lineArray; @end @implementation KBSignInView - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { CGFloat imgViewX= (FITSIZE(323)-20*7-16*2)/6; self.imgArray = [NSMutableArray arrayWithCapacity:0]; self.lineArray = [NSMutableArray arrayWithCapacity:0]; for (int i = 0; i < 7; i++) { UIImageView *imgView=[[UIImageView alloc]initWithFrame:CGRectMake(16+imgViewX*i+i*20, 0, 20, 20)]; imgView.backgroundColor=[UIColor clearColor]; // imgView.image = [UIImage imageNamed:@"noSignIn"]; [self addSubview:imgView]; [self.imgArray addObject:imgView]; if (i>0) { UIView *line = [[UIView alloc] initWithFrame:CGRectMake(16+i*20+imgViewX*(i-1), 9, imgViewX, 2)]; [self addSubview:line]; // line.backgroundColor = [UIColor colorWithHexString:@"#EF4D2D"]; [self.lineArray addObject:line]; } } } return self; } - (void)setSignModelArr:(NSArray *)array { for (int i=0; i0) { UIView *line = self.lineArray[i-1]; line.backgroundColor = [UIColor colorWithHexString:@"#F9B37F"]; } break; case 1: imgView.image = [UIImage imageNamed:@"haveSignIn"]; if (i>0) { UIView *line = self.lineArray[i-1]; line.backgroundColor = [UIColor colorWithHexString:@"#EF4D2D"]; } break; default: break; } } } } - (NSMutableArray *)imgArray { if (!_imgArray) { _imgArray = [NSMutableArray array]; } return _imgArray; } @end