Commit ce89cccb74def92ccbb1fb86d8b726f67562d50d

Authored by yanglingyu
1 parent 6ad2b766

二级分类动画bug

CNLiveVideoClassifyKit.podspec
... ... @@ -8,7 +8,7 @@
8 8  
9 9 Pod::Spec.new do |s|
10 10 s.name = 'CNLiveVideoClassifyKit'
11   - s.version = '0.0.12'
  11 + s.version = '0.0.13'
12 12 s.summary = '视讯头部一二级菜单组件'
13 13  
14 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 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
... ... @@ -27,6 +27,8 @@ NS_ASSUME_NONNULL_BEGIN
27 27  
28 28 - (void)refreshCurrentVCData;
29 29 - (void)showGuideView;
  30 +// 一级频道显示隐藏时二级频道右侧的搜索按钮变宽变窄控制
  31 +- (void)rightSubViewWithShow:(BOOL)show;
30 32  
31 33 @end
32 34  
... ...
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;
... ...