@@ -42,6 +42,8 @@ @interface DYYYSettingViewController () <UITableViewDelegate, UITableViewDataSou
42
42
@property (nonatomic , strong ) UILabel *footerLabel;
43
43
@property (nonatomic , strong ) NSMutableArray <NSString *> *sectionTitles;
44
44
@property (nonatomic , strong ) NSMutableSet *expandedSections;
45
+ @property (nonatomic , strong ) UIVisualEffectView *blurEffectView;
46
+ @property (nonatomic , strong ) UIVisualEffectView *vibrancyEffectView;
45
47
46
48
@end
47
49
@@ -53,6 +55,7 @@ - (void)viewDidLoad {
53
55
self.title = @" DYYY设置" ;
54
56
self.expandedSections = [NSMutableSet set ];
55
57
[self setupAppearance ];
58
+ [self setupBlurEffect ];
56
59
[self setupTableView ];
57
60
[self setupSettingItems ];
58
61
[self setupSectionTitles ];
@@ -61,19 +64,37 @@ - (void)viewDidLoad {
61
64
}
62
65
63
66
- (void )setupAppearance {
64
- self.view .backgroundColor = [UIColor blackColor ];
65
- self.navigationController .navigationBar .barTintColor = [UIColor blackColor ];
67
+ self.navigationController .navigationBar .barTintColor = [UIColor clearColor ];
66
68
self.navigationController .navigationBar .tintColor = [UIColor whiteColor ];
67
69
self.navigationController .navigationBar .largeTitleTextAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor ]};
68
70
self.navigationItem .largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeAlways;
69
71
self.navigationController .navigationBar .prefersLargeTitles = YES ;
70
72
}
71
73
74
+ - (void )setupBlurEffect {
75
+ UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle: UIBlurEffectStyleDark];
76
+ self.blurEffectView = [[UIVisualEffectView alloc ] initWithEffect: blurEffect];
77
+ self.blurEffectView .frame = self.view .bounds ;
78
+ self.blurEffectView .autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
79
+ [self .view addSubview: self .blurEffectView];
80
+
81
+ UIVibrancyEffect *vibrancyEffect = [UIVibrancyEffect effectForBlurEffect: blurEffect];
82
+ self.vibrancyEffectView = [[UIVisualEffectView alloc ] initWithEffect: vibrancyEffect];
83
+ self.vibrancyEffectView .frame = self.blurEffectView .bounds ;
84
+ self.vibrancyEffectView .autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
85
+ [self .blurEffectView.contentView addSubview: self .vibrancyEffectView];
86
+
87
+ UIView *overlayView = [[UIView alloc ] initWithFrame: self .view.bounds];
88
+ overlayView.backgroundColor = [UIColor colorWithWhite: 0 alpha: 0.3 ];
89
+ overlayView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
90
+ [self .view addSubview: overlayView];
91
+ }
92
+
72
93
- (void )setupTableView {
73
94
self.tableView = [[UITableView alloc ] initWithFrame: self .view.bounds style: UITableViewStyleInsetGrouped];
74
95
self.tableView .delegate = self;
75
96
self.tableView .dataSource = self;
76
- self.tableView .backgroundColor = [UIColor blackColor ];
97
+ self.tableView .backgroundColor = [UIColor clearColor ];
77
98
self.tableView .separatorStyle = UITableViewCellSeparatorStyleNone;
78
99
self.tableView .contentInset = UIEdgeInsetsMake (20 , 0 , 0 , 0 );
79
100
self.tableView .sectionHeaderTopPadding = 0 ;
@@ -141,7 +162,7 @@ - (void)setupSectionTitles {
141
162
142
163
- (void )setupFooterLabel {
143
164
self.footerLabel = [[UILabel alloc ] initWithFrame: CGRectMake (0 , 0 , self .view.bounds.size.width, 50 )];
144
- self.footerLabel .text = [NSString stringWithFormat: @" Developer By @huamidev\n Version: %@ (%@ )" , @" 2.0-4 " , @" 250307 " ];
165
+ self.footerLabel .text = [NSString stringWithFormat: @" Developer By @huamidev\n Version: %@ (%@ )" , @" 2.0-5 " , @" 250308 " ];
145
166
self.footerLabel .textAlignment = NSTextAlignmentCenter;
146
167
self.footerLabel .font = [UIFont systemFontOfSize: 14 weight: UIFontWeightRegular];
147
168
self.footerLabel .textColor = [UIColor colorWithRed: 173 /255.0 green: 216 /255.0 blue: 230 /255.0 alpha: 1.0 ];
@@ -257,18 +278,17 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
257
278
258
279
cell.textLabel .text = item.title ;
259
280
cell.textLabel .textColor = [UIColor whiteColor ];
260
- cell.backgroundColor = [UIColor colorWithRed: 28 /255.0 green: 28 /255.0 blue: 29 /255.0 alpha: 1.0 ];
281
+ cell.backgroundColor = [UIColor colorWithWhite: 1 alpha: 0.1 ];
282
+
283
+ cell.backgroundView = nil ;
261
284
262
285
if (indexPath.row == [self .settingSections[indexPath.section] count ] - 1 ) {
263
- UIView *bgView = [[UIView alloc ] initWithFrame: cell.bounds];
264
- bgView.backgroundColor = cell.backgroundColor ;
265
- cell.backgroundView = bgView;
266
-
267
- cell.backgroundView .layer .cornerRadius = 10 ;
268
- cell.backgroundView .layer .maskedCorners = kCALayerMinXMaxYCorner | kCALayerMaxXMaxYCorner ;
269
- cell.backgroundView .clipsToBounds = YES ;
286
+ cell.layer .cornerRadius = 10 ;
287
+ cell.layer .maskedCorners = kCALayerMinXMaxYCorner | kCALayerMaxXMaxYCorner ;
288
+ cell.layer .masksToBounds = YES ;
270
289
} else {
271
- cell.backgroundView = nil ;
290
+ cell.layer .cornerRadius = 0 ;
291
+ cell.layer .maskedCorners = 0 ;
272
292
}
273
293
274
294
if (item.type == DYYYSettingItemTypeSwitch) {
@@ -286,7 +306,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
286
306
attributes: @{NSForegroundColorAttributeName : [UIColor lightGrayColor ]}];
287
307
textField.text = [[NSUserDefaults standardUserDefaults ] objectForKey: item.key];
288
308
textField.textAlignment = NSTextAlignmentRight;
289
- textField.backgroundColor = [UIColor darkGrayColor ];
309
+ textField.backgroundColor = [UIColor colorWithWhite: 1 alpha: 0.1 ];
290
310
textField.textColor = [UIColor whiteColor ];
291
311
292
312
[textField addTarget: self action: @selector (textFieldDidChange: ) forControlEvents: UIControlEventEditingDidEnd];
0 commit comments