JXMoneyShareView.m 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. //
  2. // JXMoneyShareView.m
  3. // shiku_im
  4. //
  5. // Created by 123 on 2020/6/22.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXMoneyShareView.h"
  9. @interface JXMoneyShareView()<UITextViewDelegate>
  10. @property (nonatomic,weak)UILabel *timeStr;
  11. @property (nonatomic,weak) JXMoneyShareView *show;
  12. @end
  13. @implementation JXMoneyShareView
  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. JXMoneyShareView *show=[[JXMoneyShareView 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