IOS7 Navigation Facebook NavigationBar

In my application, the navigation concept is more or less the same as the iOS7 applications for Facebook / Instagram:

A ContainerViewController with 5 tabs, each of which has a NavigationController, like rootViewController.

Now I'm trying to reproduce the navigationBar behavior on Facebook for the rootViewController of the first tab of the navigationController (-> the first "real" VC, not just a container like NavVC).

I managed to implement hide / show navigationBar using delegation methods UIScrollView (scrollViewDidScroll :, scrollViewWillBeginDragging :, scrollViewDidEndDragging :)

Note: frame.origin.y of the navigation bar is manually shifted to the top. I do not use

    [self.navigationController setNavigationBarHidden:]

So far, this is really flattened. But I ran into two problems: I cannot come up with a solution for:

When I click the new ViewController on the first tab navigation stack, the navigation bar remains hidden.

To solve this problem, I do it in the pressed ViewController viewWillAppear: method:

    CGRect navBarFrame = self.navigationController.navigationBar.frame;
    navBarFrame.origin.y = 20.0;
    [UIView animateWithDuration:0.3 animations:^{
        [self.navigationController.navigationBar setFrame:navBarFrame];
    }];

This animation is correctly chosen for the pushController animation for iOS.

Problem: when I jump back (jumping out while holding VC), the navigation bar remains visible.

I managed to solve this problem by creating and setting some properties on both ViewControllers, but this is a huge mess and it will become even more hacked, because I have to push 3 or 4 different types of ViewController into this navigation stack.

My question (finally -.-):

How can I achieve pushing / popping behavior similar to Facebook?

The navigationBar of the 'old' ViewController stays hidden, while the pushed VC seems to have it's?  own navigationBar?

, : , "" navigationBar , pushController .

. " , " iOS7.

: , viewController scrollDelegate ? , UIScrollView Delegate.

:)

+4
2

: . , ViewControllers . UINavigationController UITabBarController.

, , .

+1

UINavigationController. Facebook/Instagram. navigationBar , , .

, CCSlideNavigationTransition. !

navigation bar concept as Facebook's / Instagram's iOS7 Apps

+1

All Articles