[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】
Base Info for this issue
1. How to reproduce the problem.
设备:iOS 12,CYL_IS_IPHONE_X为true(刘海屏) 逻辑:自定义页面transition动画,设置from页面需要在to页面推出时进行缩放 现象:CYLTabBar的originY被拉高
原因:在新页面Push出来时,-[CYLTabBarController viewWillLayoutSubviews]被调用,若CYL_IS_IPHONE_X为true则重设self.tabbar的frame。此时获取的self.view.frame.size.height为缩放后的高度尺寸。
这个frame在iOS 12及以上设备都会被错误设置,但在高版本系统中,在-[CYLTabBarController viewWillLayoutSubviews]调用后,系统会再次调用-[UITabBarController _layoutContainerView],这个函数中会重新设置一次tabBar的frame,导致问题在高版本会被修复。-[UITabBarController _layoutContainerView]的这段修复逻辑在iOS 12设备上没有被执行。
2. Please help me in this way.
-[CYLTabBarController viewWillLayoutSubviews]中设置tabBarFrame的逻辑是否能被移除?是否能使用autoLayout方法进行布局? 我翻阅了这段函数前后的日志,发现: frame.origin.y = self.view.frame.size.height - tabBarHeight; 这行代码在前几年曾被短暂改为: frame.origin.y = [UIScreen mainScreen].bounds.size.height - tabBarHeight; 后又被改回。这里当初的背景是?
3. Here is a Demo.
4. Here is my Debug log