forked from fyh333/MRMobileRun_iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathZYLSettingBackgound.m
More file actions
152 lines (130 loc) · 7.02 KB
/
Copy pathZYLSettingBackgound.m
File metadata and controls
152 lines (130 loc) · 7.02 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
//
// ZYLSettingBackgound.m
// MRMobileRun
//
// Created by 丁磊 on 2019/11/11.
//
#import "ZYLSettingBackgound.h"
#import <Masonry.h>
@interface ZYLSettingBackgound ()
@end
@implementation ZYLSettingBackgound
- (instancetype)init{
self = [super init];
if (self) {
[self initCells];
[self initLogoutButton];
// [self initTextField];
}
return self;
}
//- (void)initTextField{
// //输入昵称的文本框
//
// self.nicknameTextFiled = [[ZYLNicknameTextField alloc]init];
// [self addSubview:self.nicknameTextFiled];
// [self.nicknameTextFiled mas_makeConstraints:^(MASConstraintMaker *make) {
// make.edges.equalTo (self).with.insets(UIEdgeInsetsMake(305.0/1334.0*screenHeigth, 101.0/750*screenWidth, 886.0/1334.0*screenHeigth, 43.0/750.0*screenWidth));
// }];
//}
- (void)initCells{
self.iconCell = [[ZYLSettingIconCell alloc] init];
self.iconCell.frame = CGRectMake(0, 0, screenWidth, 70*kRateY);
[self addSubview: self.iconCell];
self.nicknameCell = [[ZYLSettingNameCell alloc] init];
self.nicknameCell.frame = CGRectMake(0, 70*kRateY, screenWidth, 70*kRateY);
self.nicknameCell.userInteractionEnabled = YES;
[self addSubview: self.nicknameCell];
self.signCell = [[ZYLSettingNomalCell alloc] init];
self.signCell.frame = CGRectMake(0, 140*kRateY, screenWidth, 70*kRateY);
self.signCell.textLab.text = @"个性签名";
self.signCell.iconImage.image = [UIImage imageNamed:@"setting_sign"];
[self addSubview:self.signCell];
self.aboutCell = [[ZYLSettingNomalCell alloc] init];
self.aboutCell.frame = CGRectMake(0, 210*kRateY, screenWidth, 70*kRateY);
self.aboutCell.textLab.text = @"关于约跑";
self.aboutCell.iconImage.image = [UIImage imageNamed:@"setting_about"];
[self addSubview: self.aboutCell];
self.permissionCell = [[ZYLSettingNomalCell alloc] init];
self.permissionCell.frame = CGRectMake(0, 280*kRateY, screenWidth, 70*kRateY);
self.permissionCell.textLab.text = @"运动权限设置";
self.permissionCell.iconImage.image = [UIImage imageNamed: @"setting_authority"];
[self addSubview: self.permissionCell];
self.suggestionCell = [[ZYLSettingNomalCell alloc] init];
self.suggestionCell.frame = CGRectMake(0, 350*kRateY, screenWidth, 70*kRateY);
self.suggestionCell.textLab.text = @"意见反馈";
self.suggestionCell.iconImage.image = [UIImage imageNamed:@"setting_suggestion"];
[self addSubview: self.suggestionCell];
self.switchCell = [[ZYLSettingDarkModeCell alloc] init];
self.switchCell.frame = CGRectMake(0, 420*kRateY, screenWidth, 70*kRateY);
// [self addSubview: self.switchCell];
if (UITraitCollection.currentTraitCollection.userInterfaceStyle == UIUserInterfaceStyleLight) {
}
else { //深色模式
self.iconCell.textLab.textColor = [UIColor whiteColor];
self.nicknameCell.textLab.textColor = [UIColor whiteColor];
self.signCell.textLab.textColor = [UIColor whiteColor];
self.aboutCell.textLab.textColor = [UIColor whiteColor];
self.suggestionCell.textLab.textColor = [UIColor whiteColor];
self.permissionCell.textLab.textColor = [UIColor whiteColor];
self.switchCell.textLab.textColor = [UIColor whiteColor];
self.signCell.iconImage.image = [UIImage imageNamed:@"setting_sign_dark"];
self.aboutCell.iconImage.image = [UIImage imageNamed:@"setting_about_dark"];
self.permissionCell.iconImage.image = [UIImage imageNamed: @"setting_authority_dark"];
self.suggestionCell.iconImage.image = [UIImage imageNamed:@"setting_suggestion_dark"];
self.iconCell.iconImage.image = [UIImage imageNamed:@"setting_icon_dark"];
self.nicknameCell.iconImage.image = [UIImage imageNamed:@"setting_nickname_dark"];
self.switchCell.iconImage.image = [UIImage imageNamed:@"setting_darkMode_dark"];
}
}
- (void)initLogoutButton{
self.logoutBtn = [[UIButton alloc] initWithFrame:CGRectMake(16*kRateX,540*kRateY,screenWidth-32*kRateX,52*kRateY)];
self.logoutBtn.backgroundColor = COLOR_WITH_HEX(0xFF5C77);
self.logoutBtn.layer.cornerRadius = 15*kRateX;
[self.logoutBtn setTitle:@"退出登录" forState:UIControlStateNormal];
self.logoutBtn.titleLabel.textColor = [UIColor whiteColor];
self.logoutBtn.titleLabel.font = [UIFont boldSystemFontOfSize:16*kRateX];
[self addSubview: self.logoutBtn];
}
-(void)YYZdarkChange{
if (UITraitCollection.currentTraitCollection.userInterfaceStyle == UIUserInterfaceStyleLight) {
self.iconCell.textLab.textColor = [UIColor blackColor];
self.nicknameCell.textLab.textColor = [UIColor blackColor];
self.signCell.textLab.textColor = [UIColor blackColor];
self.aboutCell.textLab.textColor = [UIColor blackColor];
self.suggestionCell.textLab.textColor = [UIColor blackColor];
self.permissionCell.textLab.textColor = [UIColor blackColor];
//self.switchCell.textLab.textColor = [UIColor blackColor];
self.signCell.iconImage.image = [UIImage imageNamed:@"setting_sign"];
self.aboutCell.iconImage.image = [UIImage imageNamed:@"setting_about"];
self.permissionCell.iconImage.image = [UIImage imageNamed: @"setting_authority"];
self.suggestionCell.iconImage.image = [UIImage imageNamed:@"setting_suggestion"];
self.iconCell.iconImage.image = [UIImage imageNamed:@"setting_icon"];
self.nicknameCell.iconImage.image = [UIImage imageNamed:@"setting_nickname"];
//self.switchCell.iconImage.image = [UIImage imageNamed:@"setting_darkMode"];
}
else { //深色模式
self.iconCell.textLab.textColor = [UIColor whiteColor];
self.nicknameCell.textLab.textColor = [UIColor whiteColor];
self.signCell.textLab.textColor = [UIColor whiteColor];
self.aboutCell.textLab.textColor = [UIColor whiteColor];
self.suggestionCell.textLab.textColor = [UIColor whiteColor];
self.permissionCell.textLab.textColor = [UIColor whiteColor];
//self.switchCell.textLab.textColor = [UIColor whiteColor];
self.signCell.iconImage.image = [UIImage imageNamed:@"setting_sign_dark"];
self.aboutCell.iconImage.image = [UIImage imageNamed:@"setting_about_dark"];
self.permissionCell.iconImage.image = [UIImage imageNamed: @"setting_authority_dark"];
self.suggestionCell.iconImage.image = [UIImage imageNamed:@"setting_suggestion_dark"];
self.iconCell.iconImage.image = [UIImage imageNamed:@"setting_icon_dark"];
self.nicknameCell.iconImage.image = [UIImage imageNamed:@"setting_nickname_dark"];
// self.switchCell.iconImage.image = [UIImage imageNamed:@"setting_darkMode_dark"];
}
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end