add
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// 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];
|
||||
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];
|
||||
}
|
||||
@end
|
||||
Reference in New Issue
Block a user