JXShareAnQuanView.m 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // JXFeedShowView.m
  3. // shiku_im
  4. //
  5. // Created by 123 on 2020/5/26.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXShareAnQuanView.h"
  9. @interface JXShareAnQuanView()
  10. @property (weak, nonatomic) IBOutlet UIView *backView;
  11. @property (weak, nonatomic) IBOutlet UIView *whiteView;
  12. @end
  13. @implementation JXShareAnQuanView
  14. +(instancetype)XIBJXShareShowView{
  15. return [[NSBundle mainBundle]loadNibNamed:@"JXShareAnQuanView" owner:self options:nil].firstObject;
  16. }
  17. -(void)awakeFromNib{
  18. [super awakeFromNib];
  19. self.konwBtn.layer.cornerRadius=12;
  20. self.konwBtn.layer.masksToBounds=YES;
  21. self.whiteView.layer.cornerRadius=12;
  22. self.whiteView.layer.masksToBounds=YES;
  23. self.backView.backgroundColor=[UIColor colorWithWhite:0.0 alpha:0.6];
  24. self.yaoqinTF.layer.cornerRadius=15;
  25. self.yaoqinTF.layer.masksToBounds=YES;
  26. self.yaoqinTF.layer.borderColor=[UIColor grayColor].CGColor;
  27. self.yaoqinTF.layer.borderWidth=1;
  28. UIView *leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 12, 30)];
  29. UIImageView *imageV=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 22, 30)];
  30. [leftView addSubview:imageV];
  31. self.yaoqinTF.leftViewMode = UITextFieldViewModeAlways;
  32. self.yaoqinTF.leftView=leftView;
  33. [self.backView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(closeView)]];
  34. }
  35. -(void)showView{
  36. JXShareAnQuanView *show=[JXShareAnQuanView XIBJXShareShowView];
  37. show.backgroundColor=[UIColor colorWithWhite:0.0 alpha:0.6];
  38. show.userInteractionEnabled=YES;
  39. show.frame=[UIScreen mainScreen].bounds;
  40. [[UIApplication sharedApplication].keyWindow addSubview:show];
  41. }
  42. - (void)closeView{
  43. [self setHidden:YES];
  44. }
  45. -(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
  46. [self endEditing:YES];
  47. }
  48. @end