BCTabBarController
BCTabBarController copied to clipboard
hidesBottomBarWhenPushed is invalid
If one tab bar uses navigationController, the self.hidesBottomBarWhenPushed is invalid when I push a new view controller. In fact I need to hide the tab bar when I push a new view controller.
hello, I have the same problem, do you have some suggest? thanks
I use the UItabBar of UIKit
This controller currently doesn't support hidesBottomBarWhenPushed. If someone could write a patch implementing this I would appreciate it. It is difficult because you need to :
- Observe UINavigationController for pushed viewControllers (could be done with KVO)
- Check that the pushed view controller has the hidesBottomBarWhenPushed property
- Resize the pushed viewController's view on the fly. I'm not sure this is possible, since the view is contained within the UINavigationController's view. I think navigation controllers interact with UITabBarControllers to arrange the resizing, something we don't have the luxury of doing without using private APIs.
- Keep the root viewController the same size (so presumably we can't resize the navigation controller's view)
Maybe I will have another shot at this but there is no easy solution.
It's implemented in fork of the project. It seems it's not difficult. See this commit https://github.com/xuzhe/BCTabBarController/commit/467ae076a8eab96f9702a6ddd00fa6f9ecf84f4b I tried to make the same in my customization and it worked
There are a couple of things wrong with that implementation.
It makes itself the delegate of every UINavigationController added to the tab bar. This is not ideal because some applications who are switching to this tab bar may already make use the delegate on their UINavigationController. It would be better to use NSNotificationCenter or KVO.
Secondly, the animation looks wrong. There is a black bar which appears as the view shifts when a new view controller is pushed. An ideal implementation would not have this.
Feel free to cherry-pick that commit or use that branch though.
On 11 September 2011 11:49, Sergei Zaplitny [email protected] wrote:
It's implemented in fork of the project. It seems it's not difficult. See this commit https://github.com/xuzhe/BCTabBarController/commit/467ae076a8eab96f9702a6ddd00fa6f9ecf84f4b I tried to make the same in my customization and it worked
Reply to this email directly or view it on GitHub: https://github.com/briancollins/BCTabBarController/issues/6#issuecomment-2063312
Later commits make animation correct
Which ones?
On 11 September 2011 12:36, Sergei Zaplitny [email protected] wrote:
Later commits make animation correct
Reply to this email directly or view it on GitHub: https://github.com/briancollins/BCTabBarController/issues/6#issuecomment-2063443
This 5a7e411ec7c286884ca1d887eae42effbefa9faa
I agree, it's not the best solution but it works and it can be useful for many people
That commit does not address the problem of the black bar as the view shifts, it just changes the animation of the tabBar disappearing and appearing.
On 11 September 2011 12:40, Sergei Zaplitny [email protected] wrote:
5a7e411ec7c286884ca1d887eae42effbefa9faa
Reply to this email directly or view it on GitHub: https://github.com/briancollins/BCTabBarController/issues/6#issuecomment-2063456
Hmm I agree people would find it useful. I want to avoid a broken implementation though. I don't know whether to include this yet.