Commit ce89cccb74def92ccbb1fb86d8b726f67562d50d
1 parent
6ad2b766
二级分类动画bug
Showing
5 changed files
with
19 additions
and
7 deletions
CNLiveVideoClassifyKit.podspec
| @@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
| 8 | 8 | ||
| 9 | Pod::Spec.new do |s| | 9 | Pod::Spec.new do |s| |
| 10 | s.name = 'CNLiveVideoClassifyKit' | 10 | s.name = 'CNLiveVideoClassifyKit' |
| 11 | - s.version = '0.0.12' | 11 | + s.version = '0.0.13' |
| 12 | s.summary = '视讯头部一二级菜单组件' | 12 | s.summary = '视讯头部一二级菜单组件' |
| 13 | 13 | ||
| 14 | # This description is used to generate tags and improve search results. | 14 | # This description is used to generate tags and improve search results. |
CNLiveVideoClassifyKit/Classes/Controller/CNLiveClassifySegmentController.m
| @@ -393,6 +393,7 @@ static CGFloat moveHeight = 50; | @@ -393,6 +393,7 @@ static CGFloat moveHeight = 50; | ||
| 393 | } | 393 | } |
| 394 | -(void)updateSelectColors:(NSInteger)index | 394 | -(void)updateSelectColors:(NSInteger)index |
| 395 | { | 395 | { |
| 396 | + self.ld_currentIndex = index; | ||
| 396 | self.myCategoryView.defaultSelectedIndex = index; | 397 | self.myCategoryView.defaultSelectedIndex = index; |
| 397 | NSString *backgroundImage = [self.bgImages safetyObjectAtIndex:index]; | 398 | NSString *backgroundImage = [self.bgImages safetyObjectAtIndex:index]; |
| 398 | weakself | 399 | weakself |
| @@ -625,9 +626,12 @@ static CGFloat moveHeight = 50; | @@ -625,9 +626,12 @@ static CGFloat moveHeight = 50; | ||
| 625 | } | 626 | } |
| 626 | } | 627 | } |
| 627 | } | 628 | } |
| 629 | + | ||
| 628 | -(void)scrollViewUpDowm:(BOOL)isUp | 630 | -(void)scrollViewUpDowm:(BOOL)isUp |
| 629 | { | 631 | { |
| 632 | + self.listContainerView.scrollView.scrollEnabled = !isUp; | ||
| 630 | self.isHiddenFirst = isUp; | 633 | self.isHiddenFirst = isUp; |
| 634 | + NSDictionary *controllers = self.listContainerView.validListDict; | ||
| 631 | [UIView animateWithDuration:0.3 animations:^{ | 635 | [UIView animateWithDuration:0.3 animations:^{ |
| 632 | if (isUp) { | 636 | if (isUp) { |
| 633 | [self scrollViewUp]; | 637 | [self scrollViewUp]; |
| @@ -635,6 +639,10 @@ static CGFloat moveHeight = 50; | @@ -635,6 +639,10 @@ static CGFloat moveHeight = 50; | ||
| 635 | { | 639 | { |
| 636 | [self scrollViewDown]; | 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,6 +709,7 @@ static CGFloat moveHeight = 50; | ||
| 701 | - (void)didSelectedCommonChannelWithIndex:(NSInteger)index | 709 | - (void)didSelectedCommonChannelWithIndex:(NSInteger)index |
| 702 | { | 710 | { |
| 703 | [self quitCustomChannels]; | 711 | [self quitCustomChannels]; |
| 712 | + self.ld_currentIndex = index; | ||
| 704 | [self.myCategoryView selectItemAtIndex:index]; | 713 | [self.myCategoryView selectItemAtIndex:index]; |
| 705 | } | 714 | } |
| 706 | 715 |
CNLiveVideoClassifyKit/Classes/Controller/CNLiveSubSegmentController.h
| @@ -27,6 +27,8 @@ NS_ASSUME_NONNULL_BEGIN | @@ -27,6 +27,8 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 27 | 27 | ||
| 28 | - (void)refreshCurrentVCData; | 28 | - (void)refreshCurrentVCData; |
| 29 | - (void)showGuideView; | 29 | - (void)showGuideView; |
| 30 | +// 一级频道显示隐藏时二级频道右侧的搜索按钮变宽变窄控制 | ||
| 31 | +- (void)rightSubViewWithShow:(BOOL)show; | ||
| 30 | 32 | ||
| 31 | @end | 33 | @end |
| 32 | 34 |
CNLiveVideoClassifyKit/Classes/Controller/CNLiveSubSegmentController.m
| @@ -174,7 +174,6 @@ | @@ -174,7 +174,6 @@ | ||
| 174 | weakself | 174 | weakself |
| 175 | [CNLiveListManager shareListManager].scrollViewDidScrollBlock = ^(BOOL isUp) { | 175 | [CNLiveListManager shareListManager].scrollViewDidScrollBlock = ^(BOOL isUp) { |
| 176 | !self.scrollViewDidScrollBlock ?: self.scrollViewDidScrollBlock(isUp); | 176 | !self.scrollViewDidScrollBlock ?: self.scrollViewDidScrollBlock(isUp); |
| 177 | - [weakSelf rightSubViewWithShow:isUp]; | ||
| 178 | }; | 177 | }; |
| 179 | // Do any additional setup after loading the view. | 178 | // Do any additional setup after loading the view. |
| 180 | } | 179 | } |
| @@ -304,10 +303,7 @@ | @@ -304,10 +303,7 @@ | ||
| 304 | } | 303 | } |
| 305 | self.listContainerView.scrollView.scrollEnabled = show; | 304 | self.listContainerView.scrollView.scrollEnabled = show; |
| 306 | self.isHiddenFirst = show; | 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 | -(void)uploadUIWithIsUp:(BOOL)isUp | 309 | -(void)uploadUIWithIsUp:(BOOL)isUp |
Example/CNLiveVideoClassifyKit/CNLIVEViewController.m
| @@ -44,7 +44,7 @@ | @@ -44,7 +44,7 @@ | ||
| 44 | [BHConfig set:ChannelsSelectFirst value:@"0"]; | 44 | [BHConfig set:ChannelsSelectFirst value:@"0"]; |
| 45 | [CNTools GetClassifyChannelsUrlsAndSave]; | 45 | [CNTools GetClassifyChannelsUrlsAndSave]; |
| 46 | self.title = @"首页"; | 46 | self.title = @"首页"; |
| 47 | - segArr = @[@"分类"]; | 47 | + segArr = @[@"分类",@"百度小程序"]; |
| 48 | [self.view addSubview:self.collectionView]; | 48 | [self.view addSubview:self.collectionView]; |
| 49 | } | 49 | } |
| 50 | -(void)viewDidAppear:(BOOL)animated | 50 | -(void)viewDidAppear:(BOOL)animated |
| @@ -74,6 +74,11 @@ | @@ -74,6 +74,11 @@ | ||
| 74 | [self.navigationController pushViewController:VC animated:YES]; | 74 | [self.navigationController pushViewController:VC animated:YES]; |
| 75 | } | 75 | } |
| 76 | break; | 76 | break; |
| 77 | + case 1: | ||
| 78 | + { | ||
| 79 | + | ||
| 80 | + } | ||
| 81 | + break; | ||
| 77 | 82 | ||
| 78 | default: | 83 | default: |
| 79 | break; | 84 | break; |