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]:iOS15设置背景色barTintColor,切换或者pop回来,颜色丢失 (OC) #581

Closed ongfei closed 2 years ago

ongfei commented 2 years ago



Base Info for this issue

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

1. How to reproduce the problem.

2. Please help me in this way.

3. Here is a Demo.

4. Here is my Debug log


ongfei commented 2 years ago

解决方案 if (@available(iOS 15.0, )) { UITabBarAppearance appearance = [UITabBarAppearance new]; [appearance configureWithOpaqueBackground]; appearance.backgroundColor = [UIColor redColor]; self.tabBar.standardAppearance = appearance; self.tabBar.scrollEdgeAppearance = appearance; }else { [[UITabBar appearance] setBarTintColor:[UIColor redColor]]; }