PrivacyViewController.m
1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// PrivacyViewController.m
// DreamSleep
//
// Created by peter on 2022/4/6.
//
#import "PrivacyViewController.h"
#import "PrivacyView.h"
@interface PrivacyViewController ()
@property (nonatomic, strong) PrivacyView *policyView;
@property (nonatomic, strong) UIView *maskView;
@end
@implementation PrivacyViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = DSWhite;
[self showPrivacyView];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
self.navigationController.navigationBarHidden = YES;
}
#pragma mark - 关闭侧滑
- (BOOL)enableInteractivePopGestureRecognizer {
return NO;
}
#pragma mark - 导航栏为NaviStyleUndef
- (NaviStyle)navigationBarStyle {
return NaviStyleUndef;
}
#pragma mark - 设置状态栏文字颜色
- (UIStatusBarStyle)preferredStatusBarStyle {
return [self.dk_manager.themeVersion isEqualToString:DKThemeVersionNormal] ? UIStatusBarStyleDefault : UIStatusBarStyleLightContent;
}
- (void)showPrivacyView {
self.policyView = [[PrivacyView alloc] init];
[self.view addSubview:self.policyView];
[self.policyView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self.view.mas_centerY);
make.centerX.equalTo(self.view.mas_centerX);
make.width.equalTo(@280);
make.height.equalTo(@236);
}];
self.policyView.hidden = NO;
self.maskView = [[UIView alloc] initWithFrame:self.view.frame];
[self.view addSubview:self.maskView];
self.maskView.backgroundColor = ColorFromRGBA(0, 0, 0, .35);
[self.view insertSubview:self.maskView belowSubview:self.policyView];
self.maskView.hidden = NO;
}
@end