5
This commit is contained in:
@@ -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
|
||||
|
||||
16
keyBoard/Class/Home/VC/HomeMainVC.h
Normal file
16
keyBoard/Class/Home/VC/HomeMainVC.h
Normal 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
|
||||
58
keyBoard/Class/Home/VC/HomeMainVC.m
Normal file
58
keyBoard/Class/Home/VC/HomeMainVC.m
Normal 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
|
||||
@@ -16,6 +16,7 @@
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
self.view.backgroundColor = [UIColor grayColor];
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -203,6 +203,7 @@
|
||||
|
||||
- (void)onTapTopButton:(UIButton *)sender {
|
||||
[self switchToIndex:sender.tag animated:YES];
|
||||
[self hw_panModalSetNeedsLayoutUpdate];
|
||||
}
|
||||
|
||||
#pragma mark - Switch Child
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
vc.minHeight = KB_SCREEN_HEIGHT - topV - 34;
|
||||
}else{
|
||||
vc.minHeight = KB_SCREEN_HEIGHT - topV;
|
||||
|
||||
//
|
||||
}
|
||||
vc.topInset = 100;
|
||||
[self presentPanModal:vc];
|
||||
|
||||
Reference in New Issue
Block a user