1
22
keyBoard/Assets.xcassets/Home/home_hg_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_hg_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_hg_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
keyBoard/Assets.xcassets/Home/home_hg_icon.imageset/home_hg_icon@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
keyBoard/Assets.xcassets/Home/home_hg_icon.imageset/home_hg_icon@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 84 KiB |
22
keyBoard/Assets.xcassets/Home/home_left_image.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "微信图片_20251107143422_215_763.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "微信图片_20251107143422_215_763 1.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
keyBoard/Assets.xcassets/Home/home_left_image.imageset/微信图片_20251107143422_215_763 1.png
vendored
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
keyBoard/Assets.xcassets/Home/home_left_image.imageset/微信图片_20251107143422_215_763.png
vendored
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
22
keyBoard/Assets.xcassets/Home/home_person_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_person_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_person_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
keyBoard/Assets.xcassets/Home/home_person_icon.imageset/home_person_icon@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
keyBoard/Assets.xcassets/Home/home_person_icon.imageset/home_person_icon@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 110 KiB |
22
keyBoard/Assets.xcassets/Home/home_right_image.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "微信图片_20251107143423_216_763.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "微信图片_20251107143423_216_763 1.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
keyBoard/Assets.xcassets/Home/home_right_image.imageset/微信图片_20251107143423_216_763 1.png
vendored
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
keyBoard/Assets.xcassets/Home/home_right_image.imageset/微信图片_20251107143423_216_763.png
vendored
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
@@ -14,6 +14,13 @@
|
||||
@property (nonatomic, strong) KBDirectionIndicatorView *indicator;
|
||||
// 顶部切换按钮与指示条
|
||||
@property (nonatomic, strong) UIView *topBar;
|
||||
@property (nonatomic, strong) UIView *contentView;
|
||||
@property (nonatomic, strong) UIImageView *leftImageView;
|
||||
@property (nonatomic, strong) UIImageView *rightImageView;
|
||||
/// 皇冠👑
|
||||
@property (nonatomic, strong) UIImageView *hgImageView;
|
||||
|
||||
|
||||
@property (nonatomic, strong) UIButton *hotButton;
|
||||
@property (nonatomic, strong) UIButton *rankButton;
|
||||
@property (nonatomic, strong) UIView *underlineView; // 选中下划线
|
||||
@@ -34,6 +41,30 @@
|
||||
// HWBackgroundConfig *config = [HWBackgroundConfig configWithBehavior:HWBackgroundBehaviorDefault];
|
||||
// config.backgroundAlpha = 0;
|
||||
// [self.hw_dimmedView reloadConfig:config];
|
||||
|
||||
// 添加容器
|
||||
[self addSubview:self.contentView];
|
||||
[self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(self).inset(16);
|
||||
make.top.equalTo(self).offset(48);
|
||||
make.bottom.equalTo(self);
|
||||
}];
|
||||
|
||||
[self.contentView addSubview:self.leftImageView];
|
||||
[self.contentView addSubview:self.rightImageView];
|
||||
[self.leftImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(self.contentView);
|
||||
make.top.equalTo(self.contentView);
|
||||
make.height.mas_equalTo(79);
|
||||
}];
|
||||
[self.rightImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(self.contentView);
|
||||
make.top.equalTo(self.contentView);
|
||||
make.height.equalTo(self.leftImageView);
|
||||
|
||||
}];
|
||||
|
||||
|
||||
// 顶部按钮 + 容器
|
||||
[self setupTopButtonsAndContainer];
|
||||
// 默认展示“热门”
|
||||
@@ -43,9 +74,9 @@
|
||||
}
|
||||
|
||||
- (HWBackgroundConfig *)backgroundConfig {
|
||||
// return [HWBackgroundConfig configWithBehavior:HWBackgroundBehaviorSystemVisualEffect];
|
||||
HWBackgroundConfig *config = [HWBackgroundConfig configWithBehavior:HWBackgroundBehaviorDefault];
|
||||
config.backgroundAlpha = 0;
|
||||
config.blurTintColor = [UIColor clearColor];
|
||||
return config;
|
||||
}
|
||||
|
||||
@@ -142,7 +173,7 @@
|
||||
- (void)setupTopButtonsAndContainer {
|
||||
// 顶部栏
|
||||
self.topBar = [[UIView alloc] init];
|
||||
self.topBar.backgroundColor = [UIColor colorWithWhite:1 alpha:0.9];
|
||||
// self.topBar.backgroundColor = [UIColor colorWithWhite:1 alpha:0.9];
|
||||
[self addSubview:self.topBar];
|
||||
// 首次展示时先隐藏,待转场完成后再淡入,避免“自底向上滑入”的错觉
|
||||
// self.topBar.alpha = 0.0;
|
||||
@@ -174,12 +205,12 @@
|
||||
|
||||
// 容器视图
|
||||
self.containerView = [[UIView alloc] init];
|
||||
self.containerView.backgroundColor = [UIColor whiteColor];
|
||||
self.containerView.backgroundColor = [UIColor redColor];
|
||||
self.containerView.clipsToBounds = YES;
|
||||
[self addSubview:self.containerView];
|
||||
|
||||
// Masonry 约束
|
||||
CGFloat topPadding = 12; // 与顶部小指示器留点空间
|
||||
CGFloat topPadding = 47; // 与顶部小指示器留点空间
|
||||
[self.topBar mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(self);
|
||||
make.top.equalTo(self).offset(topPadding);
|
||||
@@ -280,4 +311,40 @@
|
||||
[self.topBar layoutIfNeeded];
|
||||
}
|
||||
}
|
||||
|
||||
- (UIView *)contentView{
|
||||
if (!_contentView) {
|
||||
_contentView = [[UIView alloc] init];
|
||||
}
|
||||
return _contentView;
|
||||
}
|
||||
|
||||
- (UIImageView *)leftImageView{
|
||||
if (!_leftImageView) {
|
||||
_leftImageView = [[UIImageView alloc] init];
|
||||
_leftImageView.image = [UIImage imageNamed:@"home_left_image"];
|
||||
_leftImageView.contentMode = UIViewContentModeScaleToFill;
|
||||
}
|
||||
return _leftImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)rightImageView{
|
||||
if (!_rightImageView) {
|
||||
_rightImageView = [[UIImageView alloc] init];
|
||||
_rightImageView.image = [UIImage imageNamed:@"home_right_image"];
|
||||
_rightImageView.contentMode = UIViewContentModeScaleToFill;
|
||||
_rightImageView.hidden = true;
|
||||
}
|
||||
return _rightImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)hgImageView{
|
||||
if (!_hgImageView) {
|
||||
_hgImageView = [[UIImageView alloc] init];
|
||||
_hgImageView.image = [UIImage imageNamed:@"home_hg_icon"];
|
||||
_hgImageView.contentMode = UIViewContentModeScaleToFill;
|
||||
}
|
||||
return _hgImageView;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
self.titles = @[@"螃蟹啊斯柯达积分卡", @"小龙虾", @"苹果", @"胡萝卜", @"葡萄", @"西瓜"];
|
||||
[self.view addSubview:self.myCategoryView];
|
||||
[self.view addSubview:self.listContainerView];
|
||||
// self.listContainerView.scrollView.scrollEnabled = false;
|
||||
self.listContainerView.scrollView.scrollEnabled = false;
|
||||
NSArray *imageNames = @[@"crab", @"lobster", @"apple", @"carrot", @"grape", @"watermelon"];
|
||||
NSArray *selectedImageNames = @[@"crab_selected", @"lobster_selected", @"apple_selected", @"carrot_selected", @"grape_selected", @"watermelon_selected"];
|
||||
|
||||
|
||||