From a007a77db99071925612a93901f31b21d615cdfa Mon Sep 17 00:00:00 2001 From: CodeST <694468528@qq.com> Date: Mon, 10 Nov 2025 19:55:50 +0800 Subject: [PATCH] fix color --- keyBoard/Class/Me/V/KBMyHeaderView.m | 2 +- keyBoard/Class/Me/VC/MyVC.m | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/keyBoard/Class/Me/V/KBMyHeaderView.m b/keyBoard/Class/Me/V/KBMyHeaderView.m index d0d1d1d..29f55bc 100644 --- a/keyBoard/Class/Me/V/KBMyHeaderView.m +++ b/keyBoard/Class/Me/V/KBMyHeaderView.m @@ -21,7 +21,7 @@ - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { - self.backgroundColor = [UIColor colorWithHex:0xF2F6FA]; // 淡色背景 + self.backgroundColor = [UIColor clearColor]; // 透明,露出底部背景图 [self addSubview:self.titleLabel]; [self addSubview:self.keyboardBtn]; diff --git a/keyBoard/Class/Me/VC/MyVC.m b/keyBoard/Class/Me/VC/MyVC.m index 72b0ece..c044a34 100644 --- a/keyBoard/Class/Me/VC/MyVC.m +++ b/keyBoard/Class/Me/VC/MyVC.m @@ -15,13 +15,21 @@ @property (nonatomic, strong) BaseTableView *tableView; // 列表 @property (nonatomic, strong) KBMyHeaderView *header; // 顶部视图 @property (nonatomic, strong) NSArray *> *data; // 分组数据 +@property (nonatomic, strong) UIImageView *bgImageView; // 全屏背景图 @end @implementation MyVC - (void)viewDidLoad { [super viewDidLoad]; - self.view.backgroundColor = [UIColor colorWithHex:0xF5F7FB]; + // 背景图 + self.view.backgroundColor = UIColor.clearColor; + self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"my_bg_icon"]]; + self.bgImageView.contentMode = UIViewContentModeScaleAspectFill; + [self.view addSubview:self.bgImageView]; + [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self.view); + }]; // 数据源(title + SF Symbols 名称 + 色值),分两组 self.data = @[ @@ -40,6 +48,7 @@ // tableHeaderView 需要设置 frame,约束不会自动生效 self.header = [[KBMyHeaderView alloc] initWithFrame:CGRectMake(0, 0, KB_SCREEN_WIDTH, 357)]; + self.header.backgroundColor = UIColor.clearColor; // 透明,显示背景图 self.tableView.tableHeaderView = self.header; } @@ -97,7 +106,8 @@ - (BaseTableView *)tableView { if (!_tableView) { _tableView = [[BaseTableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; - _tableView.backgroundColor = [UIColor colorWithHex:0xF5F7FB]; + _tableView.backgroundColor = UIColor.clearColor; // 透明 + _tableView.opaque = NO; _tableView.delegate = self; _tableView.dataSource = self; _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; // 关闭系统分割线