// // JXOnShakeView.m // shiku_im // // Created by os on 2020/7/9. // Copyright © 2020 Reese. All rights reserved. // #import "JXOnShakeView.h" @interface JXOnShakeView() @property (nonatomic,weak)UILabel *timeStr; @property (nonatomic,weak) JXOnShakeView *show; @end @implementation JXOnShakeView -(instancetype)initWithFrame:(CGRect)frame{ if (self=[super initWithFrame:frame]) { UIView *backView=[[UIView alloc]init]; backView.backgroundColor=[UIColor colorWithWhite:0.0 alpha:0.3]; [self addSubview:backView]; [backView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(0); make.left.and.right.mas_equalTo(0); make.bottom.mas_equalTo(0); }]; UIImageView *whiteShowView=[[UIImageView alloc]init]; whiteShowView.image=[UIImage imageNamed:@"zyjMoneyB"]; whiteShowView.userInteractionEnabled=YES; [backView addSubview:whiteShowView]; [whiteShowView mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.mas_equalTo(backView.mas_centerX); make.centerY.mas_equalTo(backView.mas_centerY); //make.left.mas_equalTo(20); //make.right.mas_equalTo(-20); }]; //fenshaTitle_jinguanjia fenshaTitle UIImageView *titleIMG=[[UIImageView alloc]init]; titleIMG.image=[UIImage imageNamed:@"fenshaTitle_jinguanjia"]; titleIMG.userInteractionEnabled=YES; [whiteShowView addSubview:titleIMG]; [titleIMG mas_makeConstraints:^(MASConstraintMaker *make) { //make.top.mas_equalTo(whiteShowView.mas_top).mas_offset(15); make.bottom.mas_equalTo(-47); make.centerX.mas_equalTo(whiteShowView.mas_centerX); }]; UIButton *tongYiBtn=[[UIButton alloc]init]; tongYiBtn.titleLabel.font=[UIFont systemFontOfSize:16 weight:UIFontWeightMedium]; [tongYiBtn setImage:[UIImage imageNamed:@"zyjShare"] forState:UIControlStateNormal]; tongYiBtn.layer.cornerRadius=6; tongYiBtn.layer.masksToBounds=YES; [whiteShowView addSubview:tongYiBtn]; [tongYiBtn addTarget:self action:@selector(tongyiBtn:) forControlEvents:UIControlEventTouchUpInside]; [tongYiBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.bottom.mas_equalTo(-3); make.centerX.mas_equalTo(whiteShowView.mas_centerX); }]; } return self; } +(void)showView{ JXOnShakeView *show=[[JXOnShakeView alloc]init]; show.backgroundColor=[UIColor colorWithWhite:0.0 alpha:0.7]; show.frame=[UIScreen mainScreen].bounds; [[UIApplication sharedApplication].keyWindow addSubview:show]; } -(void)dissmisView{ [self removeFromSuperview]; } - (void)tongyiBtn:(UIButton *)sender{ [g_notify postNotificationName:@"comeBack" object:nil]; [self removeFromSuperview]; } @end