Commit ce89cccb74def92ccbb1fb86d8b726f67562d50d
1 parent
6ad2b766
二级分类动画bug
Showing
5 changed files
with
19 additions
and
7 deletions
CNLiveVideoClassifyKit.podspec
CNLiveVideoClassifyKit/Classes/Controller/CNLiveClassifySegmentController.m
| ... | ... | @@ -393,6 +393,7 @@ static CGFloat moveHeight = 50; |
| 393 | 393 | } |
| 394 | 394 | -(void)updateSelectColors:(NSInteger)index |
| 395 | 395 | { |
| 396 | + self.ld_currentIndex = index; | |
| 396 | 397 | self.myCategoryView.defaultSelectedIndex = index; |
| 397 | 398 | NSString *backgroundImage = [self.bgImages safetyObjectAtIndex:index]; |
| 398 | 399 | weakself |
| ... | ... | @@ -625,9 +626,12 @@ static CGFloat moveHeight = 50; |
| 625 | 626 | } |
| 626 | 627 | } |
| 627 | 628 | } |
| 629 | + | |
| 628 | 630 | -(void)scrollViewUpDowm:(BOOL)isUp |
| 629 | 631 | { |
| 632 | + self.listContainerView.scrollView.scrollEnabled = !isUp; | |
| 630 | 633 | self.isHiddenFirst = isUp; |
| 634 | + NSDictionary *controllers = self.listContainerView.validListDict; | |
| 631 | 635 | [UIView animateWithDuration:0.3 animations:^{ |
| 632 | 636 | if (isUp) { |
| 633 | 637 | [self scrollViewUp]; |
| ... | ... | @@ -635,6 +639,10 @@ static CGFloat moveHeight = 50; |
| 635 | 639 | { |
| 636 | 640 | [self scrollViewDown]; |
| 637 | 641 | } |
| 642 | + CNLiveSubSegmentController *subVC = controllers[@(self.ld_currentIndex)]; | |
| 643 | + if ([subVC isKindOfClass:[CNLiveSubSegmentController class]]) { | |
| 644 | + [subVC rightSubViewWithShow:isUp]; | |
| 645 | + } | |
| 638 | 646 | }]; |
| 639 | 647 | } |
| 640 | 648 | |
| ... | ... | @@ -701,6 +709,7 @@ static CGFloat moveHeight = 50; |
| 701 | 709 | - (void)didSelectedCommonChannelWithIndex:(NSInteger)index |
| 702 | 710 | { |
| 703 | 711 | [self quitCustomChannels]; |
| 712 | + self.ld_currentIndex = index; | |
| 704 | 713 | [self.myCategoryView selectItemAtIndex:index]; |
| 705 | 714 | } |
| 706 | 715 | ... | ... |
CNLiveVideoClassifyKit/Classes/Controller/CNLiveSubSegmentController.h
CNLiveVideoClassifyKit/Classes/Controller/CNLiveSubSegmentController.m
| ... | ... | @@ -174,7 +174,6 @@ |
| 174 | 174 | weakself |
| 175 | 175 | [CNLiveListManager shareListManager].scrollViewDidScrollBlock = ^(BOOL isUp) { |
| 176 | 176 | !self.scrollViewDidScrollBlock ?: self.scrollViewDidScrollBlock(isUp); |
| 177 | - [weakSelf rightSubViewWithShow:isUp]; | |
| 178 | 177 | }; |
| 179 | 178 | // Do any additional setup after loading the view. |
| 180 | 179 | } |
| ... | ... | @@ -304,10 +303,7 @@ |
| 304 | 303 | } |
| 305 | 304 | self.listContainerView.scrollView.scrollEnabled = show; |
| 306 | 305 | self.isHiddenFirst = show; |
| 307 | - weakself | |
| 308 | - [UIView animateWithDuration:0.3 animations:^{ | |
| 309 | - [weakSelf uploadUIWithIsUp:show]; | |
| 310 | - }]; | |
| 306 | + [self uploadUIWithIsUp:show]; | |
| 311 | 307 | |
| 312 | 308 | } |
| 313 | 309 | -(void)uploadUIWithIsUp:(BOOL)isUp | ... | ... |
Example/CNLiveVideoClassifyKit/CNLIVEViewController.m
| ... | ... | @@ -44,7 +44,7 @@ |
| 44 | 44 | [BHConfig set:ChannelsSelectFirst value:@"0"]; |
| 45 | 45 | [CNTools GetClassifyChannelsUrlsAndSave]; |
| 46 | 46 | self.title = @"首页"; |
| 47 | - segArr = @[@"分类"]; | |
| 47 | + segArr = @[@"分类",@"百度小程序"]; | |
| 48 | 48 | [self.view addSubview:self.collectionView]; |
| 49 | 49 | } |
| 50 | 50 | -(void)viewDidAppear:(BOOL)animated |
| ... | ... | @@ -74,6 +74,11 @@ |
| 74 | 74 | [self.navigationController pushViewController:VC animated:YES]; |
| 75 | 75 | } |
| 76 | 76 | break; |
| 77 | + case 1: | |
| 78 | + { | |
| 79 | + | |
| 80 | + } | |
| 81 | + break; | |
| 77 | 82 | |
| 78 | 83 | default: |
| 79 | 84 | break; | ... | ... |