JXOnShakeView.m 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. //
  2. // JXOnShakeView.m
  3. // shiku_im
  4. //
  5. // Created by os on 2020/7/9.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXOnShakeView.h"
  9. @interface JXOnShakeView()<UITextViewDelegate>
  10. @property (nonatomic,weak)UILabel *timeStr;
  11. @property (nonatomic,weak) JXOnShakeView *show;
  12. @end
  13. @implementation JXOnShakeView
  14. -(instancetype)initWithFrame:(CGRect)frame{
  15. if (self=[super initWithFrame:frame]) {
  16. UIView *backView=[[UIView alloc]init];
  17. backView.backgroundColor=[UIColor colorWithWhite:0.0 alpha:0.3];
  18. [self addSubview:backView];
  19. [backView mas_makeConstraints:^(MASConstraintMaker *make) {
  20. make.top.mas_equalTo(0);
  21. make.left.and.right.mas_equalTo(0);
  22. make.bottom.mas_equalTo(0);
  23. }];
  24. UIImageView *whiteShowView=[[UIImageView alloc]init];
  25. whiteShowView.image=[UIImage imageNamed:@"zyjMoneyB"];
  26. whiteShowView.userInteractionEnabled=YES;
  27. [backView addSubview:whiteShowView];
  28. [whiteShowView mas_makeConstraints:^(MASConstraintMaker *make) {
  29. make.centerX.mas_equalTo(backView.mas_centerX);
  30. make.centerY.mas_equalTo(backView.mas_centerY);
  31. //make.left.mas_equalTo(20);
  32. //make.right.mas_equalTo(-20);
  33. }];
  34. //fenshaTitle_jinguanjia fenshaTitle
  35. UIImageView *titleIMG=[[UIImageView alloc]init];
  36. titleIMG.image=[UIImage imageNamed:@"fenshaTitle_jinguanjia"];
  37. titleIMG.userInteractionEnabled=YES;
  38. [whiteShowView addSubview:titleIMG];
  39. [titleIMG mas_makeConstraints:^(MASConstraintMaker *make) {
  40. //make.top.mas_equalTo(whiteShowView.mas_top).mas_offset(15);
  41. make.bottom.mas_equalTo(-47);
  42. make.centerX.mas_equalTo(whiteShowView.mas_centerX);
  43. }];
  44. UIButton *tongYiBtn=[[UIButton alloc]init];
  45. tongYiBtn.titleLabel.font=[UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
  46. [tongYiBtn setImage:[UIImage imageNamed:@"zyjShare"] forState:UIControlStateNormal];
  47. tongYiBtn.layer.cornerRadius=6;
  48. tongYiBtn.layer.masksToBounds=YES;
  49. [whiteShowView addSubview:tongYiBtn];
  50. [tongYiBtn addTarget:self action:@selector(tongyiBtn:) forControlEvents:UIControlEventTouchUpInside];
  51. [tongYiBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  52. make.bottom.mas_equalTo(-3);
  53. make.centerX.mas_equalTo(whiteShowView.mas_centerX);
  54. }];
  55. }
  56. return self;
  57. }
  58. +(void)showView{
  59. JXOnShakeView *show=[[JXOnShakeView alloc]init];
  60. show.backgroundColor=[UIColor colorWithWhite:0.0 alpha:0.7];
  61. show.frame=[UIScreen mainScreen].bounds;
  62. [[UIApplication sharedApplication].keyWindow addSubview:show];
  63. }
  64. -(void)dissmisView{
  65. [self removeFromSuperview];
  66. }
  67. - (void)tongyiBtn:(UIButton *)sender{
  68. [g_notify postNotificationName:@"comeBack" object:nil];
  69. [self removeFromSuperview];
  70. }
  71. @end