9
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame{
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
self.backgroundColor = [UIColor blueColor];
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
@import UIKit;
|
||||
#import "HomeRankCardCell.h"
|
||||
#import "UIView+KBShadow.h"
|
||||
|
||||
@interface HomeRankCardCell ()
|
||||
@property (nonatomic, strong) UIView *shadowView; // 阴影容器(不裁剪)
|
||||
@@ -39,6 +40,9 @@
|
||||
[self.cardView addSubview:self.descLabel];
|
||||
[self.cardView addSubview:self.peopleLabel];
|
||||
[self.cardView addSubview:self.actionBtn];
|
||||
|
||||
// 统一阴影封装:在阴影容器上添加卡片阴影,阴影路径根据卡片左右 8pt 内边距进行收缩
|
||||
[self.shadowView kb_setCardShadowWithCornerRadius:18.0 insets:UIEdgeInsetsMake(0, 8, 0, 8)];
|
||||
}
|
||||
|
||||
- (void)setupConstraints {
|
||||
@@ -86,13 +90,8 @@
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
// 添加柔和阴影
|
||||
_shadowView.layer.shadowColor = [UIColor colorWithWhite:0 alpha:0.15].CGColor;
|
||||
_shadowView.layer.shadowOpacity = 1.0;
|
||||
_shadowView.layer.shadowRadius = 10.0;
|
||||
_shadowView.layer.shadowOffset = CGSizeMake(0, 6);
|
||||
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:_cardView.bounds cornerRadius:18.0];
|
||||
_shadowView.layer.shadowPath = path.CGPath;
|
||||
// 阴影路径需在尺寸确定后更新(封装方法会基于记录参数自动计算)
|
||||
[self.shadowView kb_updateShadowPath];
|
||||
|
||||
_badgeCircle.layer.cornerRadius = 34;
|
||||
}
|
||||
|
||||
@@ -30,11 +30,10 @@
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame{
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
self.backgroundColor = [UIColor redColor];
|
||||
HWBackgroundConfig *config = [HWBackgroundConfig configWithBehavior:HWBackgroundBehaviorDefault];
|
||||
config = [HWBackgroundConfig configWithBehavior:HWBackgroundBehaviorDefault];
|
||||
config.backgroundAlpha = 0.01;
|
||||
[self.hw_dimmedView reloadConfig:config];
|
||||
// self.backgroundColor = [UIColor redColor];
|
||||
// HWBackgroundConfig *config = [HWBackgroundConfig configWithBehavior:HWBackgroundBehaviorDefault];
|
||||
// config.backgroundAlpha = 0;
|
||||
// [self.hw_dimmedView reloadConfig:config];
|
||||
// 顶部按钮 + 容器
|
||||
[self setupTopButtonsAndContainer];
|
||||
// 默认展示“热门”
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
@interface HomeMainVC ()
|
||||
@property (nonatomic, strong) HomeHeadView *headView;
|
||||
@property (nonatomic, strong) KBPanModalView *simplePanModalView;
|
||||
|
||||
@end
|
||||
|
||||
@@ -19,22 +20,32 @@
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
self.view.backgroundColor = [UIColor yellowColor];
|
||||
// self.view.backgroundColor = [UIColor yellowColor];
|
||||
UIImage *bgImage = [UIImage kb_gradientImageWithColors:@[[UIColor colorWithHex:0xE8FFF1], [UIColor colorWithHex:0xD4FDFF]] size:CGSizeMake(KB_SCREEN_WIDTH, KB_SCREEN_HEIGHT) direction:KBGradientDirectionTopToBottom];
|
||||
UIImageView *bgImageView = [[UIImageView alloc] init];
|
||||
bgImageView.image = bgImage;
|
||||
[self.view addSubview:bgImageView];
|
||||
[bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.view);
|
||||
}];
|
||||
CGFloat topV = (500);
|
||||
|
||||
// [self.view addSubview:self.headView];
|
||||
// [self setupMas:topV];
|
||||
// 创建sheetVC
|
||||
KBPanModalView *simplePanModalView = [[KBPanModalView alloc] init];
|
||||
self.simplePanModalView = [[KBPanModalView alloc] init];
|
||||
// 使用宏,避免误写成函数指针判断导致恒为 true
|
||||
if (KB_DEVICE_HAS_NOTCH) {
|
||||
simplePanModalView.minHeight = KB_SCREEN_HEIGHT - topV - 34;
|
||||
self.simplePanModalView.minHeight = KB_SCREEN_HEIGHT - topV - 34;
|
||||
}else{
|
||||
simplePanModalView.minHeight = KB_SCREEN_HEIGHT - topV;
|
||||
self.simplePanModalView.minHeight = KB_SCREEN_HEIGHT - topV;
|
||||
//
|
||||
}
|
||||
simplePanModalView.topInset = 100;
|
||||
[simplePanModalView presentInView:self.view];
|
||||
self.simplePanModalView.topInset = 100;
|
||||
[self.simplePanModalView presentInView:self.view];
|
||||
HWBackgroundConfig *config = [HWBackgroundConfig configWithBehavior:HWBackgroundBehaviorDefault];
|
||||
config.backgroundAlpha = 0;
|
||||
[self.simplePanModalView.hw_dimmedView reloadConfig:config];
|
||||
}
|
||||
|
||||
- (void)setupMas:(CGFloat)headViewTopV{
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
self.view.backgroundColor = [UIColor redColor];
|
||||
HWBackgroundConfig *config = [HWBackgroundConfig configWithBehavior:HWBackgroundBehaviorDefault];
|
||||
config = [HWBackgroundConfig configWithBehavior:HWBackgroundBehaviorDefault];
|
||||
config.backgroundAlpha = 0.01;
|
||||
config.backgroundAlpha = 0.001;
|
||||
[self.hw_dimmedView reloadConfig:config];
|
||||
|
||||
// 顶部按钮 + 容器
|
||||
|
||||
Reference in New Issue
Block a user