JXGoldShareView.m 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 "JXGoldShareView.h"
  9. @interface JXGoldShareView()<UITextViewDelegate>
  10. @property (nonatomic,weak)UILabel *timeStr;
  11. @property (nonatomic,weak) JXGoldShareView *show;
  12. @end
  13. @implementation JXGoldShareView
  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. UIButton *tongYiBtn=[[UIButton alloc]init];
  35. tongYiBtn.titleLabel.font=[UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
  36. [tongYiBtn setImage:[UIImage imageNamed:@"zyjShare"] forState:UIControlStateNormal];
  37. tongYiBtn.layer.cornerRadius=6;
  38. tongYiBtn.layer.masksToBounds=YES;
  39. [whiteShowView addSubview:tongYiBtn];
  40. [tongYiBtn addTarget:self action:@selector(tongyiBtn:) forControlEvents:UIControlEventTouchUpInside];
  41. [tongYiBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  42. make.bottom.mas_equalTo(-10);
  43. make.centerX.mas_equalTo(whiteShowView.mas_centerX);
  44. }];
  45. UIImageView *titleIMG=[[UIImageView alloc]init];
  46. titleIMG.image=[UIImage imageNamed:@"fenshaTitle_jinguanjia"];
  47. titleIMG.userInteractionEnabled=YES;
  48. [whiteShowView addSubview:titleIMG];
  49. [titleIMG mas_makeConstraints:^(MASConstraintMaker *make) {
  50. //make.top.mas_equalTo(whiteShowView.mas_top).mas_offset(15);
  51. make.bottom.mas_equalTo(tongYiBtn.mas_top).offset(-5);
  52. make.centerX.mas_equalTo(whiteShowView.mas_centerX);
  53. }];
  54. }
  55. return self;
  56. }
  57. +(void)showView{
  58. JXGoldShareView *show=[[JXGoldShareView alloc]init];
  59. show.backgroundColor=[UIColor colorWithWhite:0.0 alpha:0.7];
  60. show.frame=[UIScreen mainScreen].bounds;
  61. [[UIApplication sharedApplication].keyWindow addSubview:show];
  62. }
  63. -(void)dissmisView{
  64. [self removeFromSuperview];
  65. }
  66. - (void)tongyiBtn:(UIButton *)sender{
  67. [g_notify postNotificationName:@"goldShare" object:nil];
  68. [self removeFromSuperview];
  69. }
  70. @end