diff --git a/keyBoard/Assets.xcassets/Home/home_left_bg.imageset/Contents.json b/keyBoard/Assets.xcassets/Home/home_left_bg.imageset/Contents.json new file mode 100644 index 0000000..9a26c26 --- /dev/null +++ b/keyBoard/Assets.xcassets/Home/home_left_bg.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "home_left_bg.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Home/home_left_bg.imageset/home_left_bg.png b/keyBoard/Assets.xcassets/Home/home_left_bg.imageset/home_left_bg.png new file mode 100644 index 0000000..9d3ddc8 Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/home_left_bg.imageset/home_left_bg.png differ diff --git a/keyBoard/Assets.xcassets/Home/home_right_bg.imageset/Contents.json b/keyBoard/Assets.xcassets/Home/home_right_bg.imageset/Contents.json new file mode 100644 index 0000000..88d79a3 --- /dev/null +++ b/keyBoard/Assets.xcassets/Home/home_right_bg.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "home_right_bg.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Home/home_right_bg.imageset/home_right_bg.png b/keyBoard/Assets.xcassets/Home/home_right_bg.imageset/home_right_bg.png new file mode 100644 index 0000000..4972b28 Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/home_right_bg.imageset/home_right_bg.png differ diff --git a/keyBoard/Class/Home/V/KBPanModalView.m b/keyBoard/Class/Home/V/KBPanModalView.m index 05eb457..0f5e9fe 100644 --- a/keyBoard/Class/Home/V/KBPanModalView.m +++ b/keyBoard/Class/Home/V/KBPanModalView.m @@ -44,7 +44,7 @@ // 该背景色会被 HWPanModal 用来设置容器的 _contentView 背景色 // 参考 Pods/HWPanModal/Sources/View/PanModal/HWPanModalContainerView.m: adjustPanContainerBackgroundColor // 想要改变外层白色底(截图中 _contentView)的颜色,只需改这里即可 - self.backgroundColor = [UIColor clearColor]; // 柔和的绿色 + self.backgroundColor = [UIColor colorWithHex:0xE8FFF4]; // 柔和的绿色 // HWBackgroundConfig *config = [HWBackgroundConfig configWithBehavior:HWBackgroundBehaviorDefault]; // config.backgroundAlpha = 0; // [self.hw_dimmedView reloadConfig:config]; @@ -160,8 +160,6 @@ // 添加最大的白色容器 [self addSubview:self.bigWhiteContentView]; - [self addSubview:self.personImageView]; - [self addSubview:self.hgImageView]; [self.bigWhiteContentView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.equalTo(self).inset(0); @@ -181,6 +179,10 @@ [self.secWhiteContentView addSubview:self.topBar]; [self.secWhiteContentView addSubview:self.containerView]; + // 调整层级:将人物与皇冠图添加到与 topBar 同一父视图,并放在 topBar 之下 + [self.secWhiteContentView insertSubview:self.personImageView belowSubview:self.topBar]; + [self.secWhiteContentView insertSubview:self.hgImageView belowSubview:self.topBar]; + [self.topBar addSubview:self.leftImageView]; [self.topBar addSubview:self.rightImageView]; @@ -254,6 +256,7 @@ }]; [self.personImageView mas_makeConstraints:^(MASConstraintMaker *make) { + // 仍按页面整体的左右边距定位,保持与改层级前的视觉一致 make.left.equalTo(self).offset(46); make.bottom.equalTo(self.topBar.mas_top).offset(22); make.width.mas_equalTo(70); @@ -351,7 +354,8 @@ _bigWhiteContentView = [[UIView alloc] init]; _bigWhiteContentView.backgroundColor = [UIColor whiteColor]; _bigWhiteContentView.layer.cornerRadius = 40; - _bigWhiteContentView.layer.masksToBounds = true; + // 不裁剪子视图,避免顶部装饰图越界部分被截断 + _bigWhiteContentView.layer.masksToBounds = NO; // 等同于 clipsToBounds = NO } return _bigWhiteContentView; }