ChenYilong / CYLTabBarController

[EN]It is an iOS UI module library for adding animation to iOS tabbar items and icons with Lottie, and adding a bigger center UITabBar Item. [CN]【中国特色 TabBar】一行代码实现 Lottie 动画TabBar,支持中间带+号的TabBar样式,自带红点角标,支持动态刷新。【iOS13 & Dark Mode & iPhone XS MAX supported】
MIT License
6.92k stars 1.46k forks source link

indexOfPlusButtonInTabBar 指定位置的问题 #225

Closed xuanlingzi closed 6 years ago

xuanlingzi commented 6 years ago

Base Info for this issue

  1. Version:v1.16.0
  2. Language:Objective-C
  3. iOS System Version:iOS11
  4. Prototype(是否是真机):NO
  5. Issue Type:Bug

1. How to repeat the problem.

Example 的 CYLPlusButtonSubclass.m 使用 plusChildViewController 方式,只要 indexOfPlusButtonInTabBar 指定的是0-3的位置,则会出现图中情况

2017-12-25 10 34 54

2. Please help me in this way.

有没有办法在不加PlusButton的方式,只放大某个 TabBarItem 的图片

3. Here is a Demo.

4. Here is my Debug log

选择其他TabItem,第一次点击PlusButton 2017-12-25 10:38:20.551200+0800 CYLTabBarController[57418:7851241] 🔴类名与方法名:+[CYLPlusButtonSubclass shouldSelectPlusChildViewController](在第153行),描述:PlusButton is not selected 继续点击 PlusButton 2017-12-25 10:38:22.867790+0800 CYLTabBarController[57418:7851241] 🔴类名与方法名:+[CYLPlusButtonSubclass shouldSelectPlusChildViewController](在第151行),描述:PlusButton is selected 2017-12-25 10:38:26.491625+0800 CYLTabBarController[57418:7851241] 🔴类名与方法名:+[CYLPlusButtonSubclass shouldSelectPlusChildViewController](在第151行),描述:PlusButton is selected

HobaoKing commented 6 years ago

我也遇到相同的问题, ` + (UIViewController )plusChildViewController { UIViewController plusChildViewController = [[UIViewController alloc] init]; plusChildViewController.view.backgroundColor = [UIColor redColor]; plusChildViewController.navigationItem.title = @"PlusChildViewController"; UIViewController *plusChildNavigationController = [[UINavigationController alloc] initWithRootViewController:plusChildViewController]; return plusChildNavigationController; }

kangtian commented 6 years ago

我也遇到了啊 DOME 也没这样的样品

LokiLLJ commented 6 years ago

修改一下源码吧, 我也遇到这个问题了, 作者在计算TabBar的X坐标的时候 出现了错误。 我把修改后的放上来。 [self.tabBarButtonArray enumerateObjectsUsingBlock:^(UIView _Nonnull childView, NSUInteger buttonIndex, BOOL _Nonnull stop) { //调整UITabBarItem的位置 CGFloat childViewX; //by Loki if (buttonIndex <= plusButtonIndex) { childViewX = buttonIndex CYLTabBarItemWidth; }else { childViewX = (buttonIndex - 1) CYLTabBarItemWidth + CYLPlusButtonWidth; } //Old // if (buttonIndex >= plusButtonIndex) { // childViewX = buttonIndex CYLTabBarItemWidth + CYLPlusButtonWidth; // } else { // childViewX = buttonIndex CYLTabBarItemWidth; // } //仅修改childView的x和宽度,yh值不变 childView.frame = CGRectMake(childViewX, CGRectGetMinY(childView.frame), CYLTabBarItemWidth, CGRectGetHeight(childView.frame) ); }]; 已经邮件通知了作者,看作者会不会看到我的邮件把。😄

ChenYilong commented 6 years ago

@xuanlingzi @HobaoKing @kangtian @mrliu555464 @pengqun v1.17.5版本已经发布修复了该问题,请更新重试。