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.9k stars 1.45k forks source link

[bug]:最新版本,在工程新增自定义window后,代码修改selectedIndex会出现图片不变只变文字的情况 #575

Closed ldy694 closed 2 years ago

ldy694 commented 2 years ago



Base Info for this issue

  1. Version:pod 'CYLTabBarController/Lottie', '1.29.2'
  2. Language of App :Swift
  3. iOS System Version:iOS15.0.1
  4. Prototype(是否是真机):YES
  5. Issue Type:Bug

1. How to reproduce the problem.

1、自定义一个window,之后不管在什么地方调用cyl_popSelectTabBarChildViewController或selectedIndex会出现文字变色,图片没变化。 2、没有创建自定义window时是正常的。

例如:我现在tabBarController.selectedIndex = 0,自定义一个弹窗view,把它加在一个自定义的window上,一旦这个弹窗生成后,再通过代码调用cyl_popSelectTabBarChildViewController(at: 2, animated: true),此时tabBarController.selectedIndex = 2,页面也切到了。但是,只有文字颜色变了,图片没变化,但是用手去切是正常的

2. Please help me in this way.

在自定义了window时,也可以正常的通过代码改selectedIndex

3. Here is a Demo.

4. Here is my Debug log


ChenYilong commented 2 years ago

自定义一个window, 这个具体点, 做什么用的?

ldy694 commented 2 years ago

@ChenYilong 放自定义弹窗view的,比如有新版本提醒更新,一个自定义的全局活动弹窗提醒等等,自定义的window与工程默认的window是各自独立存在的。

ldy694 commented 2 years ago

@ChenYilong 给个邮箱,我把demo发给你看看

ldy694 commented 2 years ago

CYLTabbarDemo.zip @ChenYilong 这个是demo

ChenYilong commented 2 years ago

CYLTabbarDemo.zip @ChenYilong 这个是demo

收到, 我看看

ldy694 commented 2 years ago

@ChenYilong 幸苦了,谢谢🙏

ldy694 commented 2 years ago

@ChenYilong 你好,有解决办法吗?

ldy694 commented 2 years ago

@ChenYilong 我好像找到原因了,一旦设置了 image ,下次再通过代码跳转前得再设置了,把shouldSelect设为true才行