// // CustomImageBackView.m // Lighting // // Created by 曹云霄 on 2016/12/8. // Copyright © 2016年 上海勾芒科技有限公司. All rights reserved. // #import "CustomImageBackView.h" @implementation CustomImageBackView - (void)awakeFromNib { [super awakeFromNib]; CGFloat width = 150; CGFloat interval = 15; for (int i=0; i<3; i++) { UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(i*width+i*interval, 0, width, width)]; imageView.userInteractionEnabled = YES; imageView.tag = i; [imageView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(TapClickAction:)]]; [self addSubview:imageView]; if (i == 2) { UILabel *instruction = [[UILabel alloc] initWithFrame:CGRectMake(width-50, width-15, 50, 15)]; instruction.text = @"共4张"; instruction.font = [UIFont systemFontOfSize:10]; instruction.textColor = [UIColor whiteColor]; instruction.textAlignment = NSTextAlignmentCenter; instruction.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5]; [imageView addSubview:instruction]; } } } #pragma mark - 更新View - (void)setImageArray:(NSArray *)imageArray { _imageArray = imageArray; for (int i=0;i