Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hidesBottomBarWhenPushed is invalid #6

Open
scorpiozj opened this issue Jun 21, 2011 · 10 comments
Open

hidesBottomBarWhenPushed is invalid #6

scorpiozj opened this issue Jun 21, 2011 · 10 comments

Comments

@scorpiozj
Copy link

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.

@wwwangxuefei
Copy link

hello, I have the same problem, do you have some suggest? thanks

@scorpiozj
Copy link
Author

I use the UItabBar of UIKit

@briancollins
Copy link
Owner

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 :

  1. Observe UINavigationController for pushed viewControllers (could be done with KVO)
  2. Check that the pushed view controller has the hidesBottomBarWhenPushed property
  3. 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.
  4. 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.

@zaplitny
Copy link

It's implemented in fork of the project. It seems it's not difficult. See this commit xuzhe@467ae07
I tried to make the same in my customization and it worked

@briancollins
Copy link
Owner

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 xuzhe@467ae07
I tried to make the same in my customization and it worked

Reply to this email directly or view it on GitHub:
#6 (comment)

@zaplitny
Copy link

Later commits make animation correct

@briancollins
Copy link
Owner

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:
#6 (comment)

@zaplitny
Copy link

This 5a7e411

I agree, it's not the best solution but it works and it can be useful for many people

@briancollins
Copy link
Owner

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:

5a7e411

Reply to this email directly or view it on GitHub:
#6 (comment)

@briancollins
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants