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

[bug]:没有中间PlusButton时iOS14 tabBar文字变为... #530

Closed LustySwimmer closed 3 years ago

LustySwimmer commented 3 years ago



Base Info for this issue

  1. Version:Latest Version as here
  2. Language of App :Objective-C/Swift
  3. iOS System Version:iOS14
  4. Prototype(是否是真机):YES
  5. Issue Type:Crash、Bug、Enhancement(希望能支持一个新需求)、Q-A

1. How to reproduce the problem.

1、demo中不添加中间plusButton 2、从任意tab点击进入二级页面->切后台->返回前台->返回一级页面,按照这个操作执行两次或多次(两次基本重现) iOS14系统真机模拟器均可稳定重现,有plusButton则没有这个问题,应该跟CYLTabBar的layoutSubviews计算有关

2. Please help me in this way.

3. Here is a Demo.

CYLTabBarController-master.zip Simulator Screen Shot - iPhone 11 Pro Max - 2020-09-27 at 17 25 38

4. Here is my Debug log


LustySwimmer commented 3 years ago

临时解决方案: 对tabBar上的label添加了hook layoutSubviews处理,设置其宽度与父视图宽度一致; 可以打开demo中MainTabBarController里面viewDidLayoutSubviews被注释掉的代码验证

ChenYilong commented 3 years ago

新版本v1.29.1中已修复 

变更记录见: https://github.com/ChenYilong/CYLTabBarController/commit/062ad52c9cb0cee9fabbb9de6c3a0ad893713d86