4
votes

I have 3 views connected together via a navigation controller. The middle view (#2) has special styling in that the navigation bar and toolbar are completely white to blend in with the white background.

When swiping to/from view 2 the navigation and toolbar transition is animated (as is the default) to slowly fade in the buttons and styling of the view being pushed/popped i.e. the navigation bar and toolbar remain visible during the transition.

This ends up not looking to great because of the white navigation bar and toolbar of view 2.

What I would like to achieve instead is to have each view pushed/popped in entirety i.e. including its navigation bar and toolbar. In other words, instead of the navigation bar and toolbar to persist during the transition, I would like them to slide in/out with the view they are part of.

I have attached screenshots of the 2 variants.

Would it be best to scrap the navigation controller and set up each view with its own navigation bar and toolbar? Or can this be achieved easily for my current setup.

It would be great if someone could point me in the right direction.


This is from the Apple Remote app showing the effect I would like to create.

remote-app

This is from the Apple Mail app showing the default transition effect.

mail-app

3

3 Answers

0
votes

Create your view with the desired screen with navigation bar & tollbar.

On the action bring the view 2 or remove with the animation your want using view animation.

[UIView animateWithDuration:0.2
 animations:^{set your fram(0,0,320,480/568) or (320,0,320,480/568)}
 completion:^(BOOL finished){ 
 }];

You can add the view to keywindow.

Hope this will help you.

0
votes

Use custom transitions between view controllers will give you a better effect than animating UIView's, though you can add physics behaviors to UIView objects to make it more interesting.

Apple uses interactive custom transitions (just look that up) for its own apps. Here is a good article about that too:

http://www.doubleencore.com/2013/09/ios-7-custom-transitions/

0
votes

Why don't you simply use the hidesBottomBarWhenPushed property over the destination view controller?

        // hide the bottom tabbar when we push this view controller
        destinationViewController.hidesBottomBarWhenPushed = YES;