This commit is contained in:
2025-11-06 16:05:28 +08:00
parent 41aec6b89e
commit 1f45564539
10 changed files with 395 additions and 15 deletions

View File

@@ -9,6 +9,8 @@
//
#import "KBTopThreeView.h"
#import "HomeHotCell.h"
#import "HomeRankVC.h"
#import <HWPanModal/HWPanModal.h>
@interface HomeHotVC () <UITableViewDataSource, UITableViewDelegate>
@@ -80,6 +82,8 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
HomeRankVC *vc = [[HomeRankVC alloc] init];
[self.navigationController pushViewController:vc animated:true];
}
#pragma mark - Lazy

View File

@@ -0,0 +1,16 @@
//
// HomeMainVC.h
// keyBoard
//
// Created by Mac on 2025/11/6.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface HomeMainVC : UIViewController
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,58 @@
//
// HomeMainVC.m
// keyBoard
//
// Created by Mac on 2025/11/6.
//
#import "HomeMainVC.h"
#import "HomeHeadView.h"
#import "KBPanModalView.h"
@interface HomeMainVC ()
@property (nonatomic, strong) HomeHeadView *headView;
@end
@implementation HomeMainVC
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor yellowColor];
CGFloat topV = (500);
// [self.view addSubview:self.headView];
// [self setupMas:topV];
// sheetVC
KBPanModalView *simplePanModalView = [[KBPanModalView alloc] init];
// 使 true
if (KB_DEVICE_HAS_NOTCH) {
simplePanModalView.minHeight = KB_SCREEN_HEIGHT - topV - 34;
}else{
simplePanModalView.minHeight = KB_SCREEN_HEIGHT - topV;
//
}
simplePanModalView.topInset = 100;
[simplePanModalView presentInView:self.view];
}
- (void)setupMas:(CGFloat)headViewTopV{
[self.headView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.view);
make.top.equalTo(self.view);
make.height.mas_equalTo(headViewTopV);
}];
}
#pragma mark - lazy
- (HomeHeadView *)headView{
if (!_headView) {
_headView = [[HomeHeadView alloc] init];
}
return _headView;
}
@end

View File

@@ -16,6 +16,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = [UIColor grayColor];
}
/*

View File

@@ -203,6 +203,7 @@
- (void)onTapTopButton:(UIButton *)sender {
[self switchToIndex:sender.tag animated:YES];
[self hw_panModalSetNeedsLayoutUpdate];
}
#pragma mark - Switch Child

View File

@@ -30,7 +30,7 @@
vc.minHeight = KB_SCREEN_HEIGHT - topV - 34;
}else{
vc.minHeight = KB_SCREEN_HEIGHT - topV;
//
}
vc.topInset = 100;
[self presentPanModal:vc];