// // MaskViewBootomWaringView.m // GIGA // // Created by lianxiang on 2018/8/20. // Copyright © 2018年 com.giga.ios. All rights reserved. // #import "MaskViewBootomWaringView.h" #import "Masonry.h" @implementation MaskViewBootomWaringView -(instancetype)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; if (self) { self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.8]; [self setUpUI]; } return self; } -(void)setUpUI{ UIImageView *iconImg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@""]]; iconImg.backgroundColor = [UIColor redColor]; [self addSubview:iconImg]; [iconImg mas_makeConstraints:^(MASConstraintMaker *make) { make.width.and.height.mas_equalTo(40); make.left.mas_equalTo(10); make.centerY.mas_equalTo(self.mas_centerY); }]; UILabel *waringLabel = [[UILabel alloc] init]; waringLabel.text = @"亲爱滴,请您务必要开启手机声音哦"; waringLabel.textColor = [UIColor whiteColor]; waringLabel.textAlignment = NSTextAlignmentCenter; waringLabel.font = [UIFont systemFontOfSize:16]; [waringLabel sizeToFit]; [self addSubview:waringLabel]; [waringLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(iconImg.mas_right).offset(10); make.centerY.mas_equalTo(self.mas_centerY); }]; GiGaBlockButton *dismisBtn = [GiGaBlockButton buttonWithType:UIButtonTypeCustom]; [dismisBtn setImage:[UIImage imageNamed:@"maske_dismiss_waring"] forState:UIControlStateNormal]; [dismisBtn setContentMode:UIViewContentModeScaleAspectFill]; self.dismissBtn = dismisBtn; [self addSubview:dismisBtn]; [dismisBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.right.mas_equalTo(self.mas_right).offset(10); make.centerY.mas_equalTo(self.mas_centerY); make.width.and.height.mas_equalTo(40); }]; } @end