Reputation: 347
The pushed controller cross over current controller.
Results are as follows:
image 0
Actually, I have hook into this app, it use a subclass named MMUINavigationController, and I am sure current action is "pushViewController:animated:", it's the interface I hooked.
how to make it ?
additional,standar animation:
image 3
navigation bar of pushed controller
image 4
Upvotes: 0
Views: 375
Reputation: 939
Here's one solution:
For the last point you can add a pan gesture recognizer (suggested) or simply set the interactivePopGestureRecognizer's delegate of the navigation controller to nil:
self.navigationController?.interactivePopGestureRecognizer?.delegate = nil;
but please refer to this discussion for its implications: No Swipe Back when hiding Navigation Bar in UINavigationController
EDIT:
Working solution which fulfills the requirements: just setting the navigationBarHidden
in the viewWillAppear
does the magic.
I've setup a sample demo here: https://github.com/ldantona/NavigationBarExample
EDIT 2:
Just found this library, could it be of any help? https://github.com/MoZhouqi/KMNavigationBarTransition
The library can capture the background style of the navigation bar in the disappearing view controller when pushing, and when you pop back to the view controller, the navigation bar will restore the previous style, so you don't need to consider the background style after popping. And you also don't need to consider it after pushing, because it is the view controller to be pushed that needs to be considered.
Hope it helps
Upvotes: 1