充值选中背景色

This commit is contained in:
chenshuanglin
2023-03-17 21:46:02 +08:00
parent df0e4b36d6
commit ca10cb456f
3 changed files with 17 additions and 5 deletions

View File

@@ -76,7 +76,13 @@
- (void)setSelectedStyle:(BOOL)selectedStyle { - (void)setSelectedStyle:(BOOL)selectedStyle {
_selectedStyle = selectedStyle; _selectedStyle = selectedStyle;
self.selectedBgView.hidden = !selectedStyle; if (selectedStyle) {
self.selectedBgView.hidden = NO;
self.bgView.backgroundColor = UIColor.clearColor;
}else{
self.selectedBgView.hidden = YES;
self.bgView.backgroundColor = [ThemeColor colorWithHexString:@"#F8F8FA"];
}
} }
#pragma mark - Getters And Setters #pragma mark - Getters And Setters
@@ -93,7 +99,7 @@
- (UIView *)selectedBgView { - (UIView *)selectedBgView {
if (!_selectedBgView) { if (!_selectedBgView) {
_selectedBgView = [[UIView alloc] init]; _selectedBgView = [[UIView alloc] init];
_selectedBgView.backgroundColor = [[ThemeColor appMainColor] colorWithAlphaComponent:0.1]; _selectedBgView.backgroundColor = [[ThemeColor appMainColor] colorWithAlphaComponent:0.15];
_selectedBgView.layer.cornerRadius = 5; _selectedBgView.layer.cornerRadius = 5;
_selectedBgView.layer.borderWidth = 1; _selectedBgView.layer.borderWidth = 1;
_selectedBgView.layer.borderColor = [ThemeColor appMainColor].CGColor; _selectedBgView.layer.borderColor = [ThemeColor appMainColor].CGColor;

View File

@@ -67,7 +67,13 @@
- (void)setSelectedStyle:(BOOL)selectedStyle { - (void)setSelectedStyle:(BOOL)selectedStyle {
_selectedStyle = selectedStyle; _selectedStyle = selectedStyle;
self.selectedBgView.hidden = !selectedStyle; if (selectedStyle) {
self.selectedBgView.hidden = NO;
self.bgView.backgroundColor = UIColor.clearColor;
}else{
self.selectedBgView.hidden = YES;
self.bgView.backgroundColor = [ThemeColor colorWithHexString:@"#F8F8FA"];
}
} }
- (UIView *)bgView { - (UIView *)bgView {
@@ -82,7 +88,7 @@
- (UIView *)selectedBgView { - (UIView *)selectedBgView {
if (!_selectedBgView) { if (!_selectedBgView) {
_selectedBgView = [[UIView alloc] init]; _selectedBgView = [[UIView alloc] init];
_selectedBgView.backgroundColor = [[ThemeColor appMainColor] colorWithAlphaComponent:0.1]; _selectedBgView.backgroundColor = [[ThemeColor appMainColor] colorWithAlphaComponent:0.15];
_selectedBgView.layer.cornerRadius = 5; _selectedBgView.layer.cornerRadius = 5;
_selectedBgView.layer.borderWidth = 1; _selectedBgView.layer.borderWidth = 1;
_selectedBgView.layer.borderColor = [ThemeColor appMainColor].CGColor; _selectedBgView.layer.borderColor = [ThemeColor appMainColor].CGColor;

View File

@@ -153,7 +153,7 @@
[self.settingButton mas_makeConstraints:^(MASConstraintMaker *make) { [self.settingButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(24, 24)); make.size.mas_equalTo(CGSizeMake(24, 24));
make.right.mas_equalTo(self.view).offset(-15); make.right.mas_equalTo(self.view).offset(-15);
make.top.mas_equalTo(self.view).offset(kStatusBarHeight + 15); make.top.mas_equalTo(self.view).offset(kStatusBarHeight + 12);
}]; }];
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {