This commit is contained in:
2025-11-06 19:19:12 +08:00
parent a75afbe4c1
commit 6ba1339c0b
195 changed files with 13443 additions and 2729 deletions

View File

@@ -23,6 +23,8 @@
@property (nonatomic, strong) UIViewController *currentChild;
@property (nonatomic, strong) HomeHotVC *hotVC;
@property (nonatomic, strong) HomeRankVC *rankVC;
@property (nonatomic, assign) NSInteger currentIndex;
@end
@implementation KBPanModalView
@@ -83,6 +85,10 @@
return NO; // short
}
- (CGFloat)topOffset{
return 0.001;
}
/// 穿
- (BOOL)allowsTouchEventsPassingThroughTransitionView {
return YES;
@@ -94,7 +100,10 @@
- (UIScrollView *)panScrollable {
return self.hotVC.tableView;
if (self.currentIndex == 0) {
return self.hotVC.tableView;
}
return self.rankVC.tableView;
}
//
@@ -130,7 +139,7 @@
self.topBar.backgroundColor = [UIColor colorWithWhite:1 alpha:0.9];
[self addSubview:self.topBar];
//
self.topBar.alpha = 0.0;
// self.topBar.alpha = 0.0;
//
self.hotButton = [UIButton buttonWithType:UIButtonTypeCustom];
@@ -200,12 +209,13 @@
- (void)onTapTopButton:(UIButton *)sender {
[self switchToIndex:sender.tag animated:YES];
[self hw_panModalSetNeedsLayoutUpdate];
// [self hw_panModalSetNeedsLayoutUpdate];
}
#pragma mark - Switch Child
- (void)switchToIndex:(NSInteger)index animated:(BOOL)animated {
self.currentIndex = index;
UIViewController *target = (index == 0) ? self.hotVC : self.rankVC;
if (!target) {
if (index == 0) {
@@ -235,11 +245,11 @@
[self.containerView addSubview:target.view];
target.view.backgroundColor = [UIColor colorWithWhite:0.98 alpha:1];
[target.view mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.containerView);
make.left.top.right.equalTo(self.containerView);
make.bottom.equalTo(self.containerView).offset(-KB_TABBAR_HEIGHT);
}];
[target didMoveToParentViewController:self];
// [target didMoveToParentViewController:self];
self.currentChild = target;
[self updateButtonStateForIndex:index animated:animated];
}