Ramotion / animated-tab-bar

:octocat: RAMAnimatedTabBarController is a Swift UI module library for adding animation to iOS tabbar items and icons. iOS library made by @Ramotion
https://www.ramotion.com/animated-tab-bar-ios-app-development-ui-library/
MIT License
11.12k stars 1.33k forks source link

TabBarItems are not hidden on push #263

Closed vkondrashkov closed 4 years ago

vkondrashkov commented 4 years ago

Issue steps

  1. Create RAMTabBarController
  2. Add UINavigationController with RAMTabBarItem
  3. Push UIViewController with hidesBottomBarWhenPushed set to true

AR: TabBarItem's are visible. ER: TabBarItem's are hiding with push transition.

Issue description

While you're using native UITabBarController you can store UINavgiationController which provides behaviour of hiding tab bar on push. To achieve it you need to set hidesBottomBarWhenPushed to true and tab bar disappears on pushing transition.

But RAMAnimatedTabBarController partly ignores such property or works incorrectly. Tab bar is disappearing on transition but all TabBar items are not. Also they're responsible so you can change tab view.

Why this happening?

It appears that RAMAnimatedTabBarController add all TabBarItem containers directly to view not to tabBar so on pushed UIViewController they're still visible

How to solve it?

You need to add all of these containers to tabBar. Also there're an issue with constraints, you can't use constraints inside tabBar (as I investigated, maybe I'm mistaken), so you need to change constraints to frame set up.

Thanks for attention and I hope you'll solve it in next release