79 lines
1.8 KiB
Objective-C
79 lines
1.8 KiB
Objective-C
//
|
|
// MaskResultCandView.m
|
|
// GIGA
|
|
//
|
|
// Created by lianxiang on 2018/9/20.
|
|
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
|
//
|
|
|
|
#import "MaskResultCandView.h"
|
|
|
|
@implementation MaskResultCandView
|
|
|
|
- (instancetype)initWith:(NSArray *)images{
|
|
self = [super init];
|
|
if (self) {
|
|
|
|
self.imagesArr = images;
|
|
[self creatSubs];
|
|
}
|
|
return self;
|
|
|
|
}
|
|
|
|
-(void)creatSubs{
|
|
|
|
for (NSInteger i=0; i<self.imagesArr.count; i ++) {
|
|
|
|
UIImageView *image = [[UIImageView alloc] init];
|
|
|
|
if (i==0) {
|
|
self.shuiImageView = image;
|
|
}else if (i==1){
|
|
self.meibaiImageView = image;
|
|
}else if (i==2){
|
|
self.tilaImageView= image;
|
|
}
|
|
|
|
image.contentMode = UIViewContentModeScaleAspectFill;
|
|
image.image = [UIImage imageNamed:self.imagesArr[i]];
|
|
image.layer.shadowColor = [UIColor blackColor].CGColor;
|
|
image.layer.shadowOpacity = 0.2;
|
|
image.layer.shadowOffset = CGSizeMake(0, 1);
|
|
[self addSubview:image];
|
|
[image mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.size.mas_equalTo(CGSizeMake(20, 29));
|
|
make.left.mas_equalTo(self.mas_left).offset(i*(8 + 20));
|
|
make.centerY.mas_equalTo(self.mas_centerY);
|
|
}];
|
|
|
|
}
|
|
}
|
|
|
|
-(void)layoutIfNeeded{
|
|
[super layoutIfNeeded];
|
|
|
|
}
|
|
|
|
-(void)layoutSubviews{
|
|
[super layoutSubviews];
|
|
|
|
//[self creatSubs];
|
|
}
|
|
|
|
-(void)updateImages:(NSArray *)images
|
|
{
|
|
for (NSInteger i=0; i<images.count; i++) {
|
|
if (i==0) {
|
|
self.shuiImageView.image = [UIImage imageNamed:images[i]];
|
|
}else if (i==1){
|
|
self.meibaiImageView.image = [UIImage imageNamed:images[i]];
|
|
}else{
|
|
self.tilaImageView.image = [UIImage imageNamed:images[i]];
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@end
|