1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- //
- // JXShowMainView.m
- // shiku_im
- //
- // Created by 123 on 2020/6/11.
- // Copyright © 2020 Reese. All rights reserved.
- //
- #import "JXShowMainView.h"
- @interface JXShowMainView()<UITextViewDelegate>
- @property (weak, nonatomic) IBOutlet UIView *whiteView;
- @property (nonatomic,weak) JXShowMainView *showView;
- @property (weak, nonatomic) IBOutlet UIButton *closeButton;
- @end
- @implementation JXShowMainView
- +(instancetype)XIBJXShowMainView{
-
- return [[NSBundle mainBundle]loadNibNamed:@"JXShowMainView" owner:self options:nil].firstObject;
- }
- -(void)awakeFromNib{
- [super awakeFromNib];
- self.userInteractionEnabled=YES;
- _whiteView.layer.cornerRadius=12;
- _whiteView.layer.masksToBounds=YES;
- _closeButton.layer.cornerRadius=18;
- _closeButton.layer.masksToBounds=YES;
- _closeButton.layer.borderColor=[UIColor whiteColor].CGColor;
- _closeButton.layer.borderWidth=1;
- _whiteView.backgroundColor=[UIColor colorWithWhite:1.0 alpha:0.9];
- [_closeButton addTarget:self action:@selector(closeBtn:) forControlEvents:UIControlEventTouchUpInside];
- }
- +(void)showView{
- JXShowMainView *show=[JXShowMainView XIBJXShowMainView];
- show.backgroundColor=[UIColor colorWithWhite:0.0 alpha:0.3];
- show.frame=[UIScreen mainScreen].bounds;
- [[UIApplication sharedApplication].keyWindow addSubview:show];
-
- }
- - (IBAction)closeBtn:(UIButton *)sender {
- [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"33000"];
- [self removeFromSuperview];
- [self removeFromSuperview];
- }
- @end
|