How can I stop the tab bar, ruining my transition?

I created an iOS app bar app with a navigation controller on one of the tabs. It uses flip animation when it pops or pops up from the stack (I learned how to do it here ).

It looks great, except for a problem with the tab bar. In the view, the tab bar is displayed on the root stack, but for the next I set hidesBottomBarWhenPushedto YES. Pushing works fine; the problem returns to the root view controller. My gaze is cast to the left, with the exception of the tab bar, which slides.

Here is my code to call the controller of the form:

[UIView beginAnimations:nil context:nil];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft
                       forView:self.navigationController.view
                         cache:NO];
[UIView setAnimationDuration:flipDuration];
[self.navigationController popViewControllerAnimated:NO];
[UIView commitAnimations];

It is strange that if I comment on everything except the fourth statement, the tab bar behaves itself - it does not slide, it just appears instantly with the rest. For some reason, adding a transition allowed the tab bar to say to itself: “Well, everyone else is animated. Why shouldn't I be animated? But I didn't get pissed off. I think I will stick to the slide.

What can I do? Ideally, I would like the tab bar to flip over with the rest, but I would also be pleased that it gradually disappeared.

+5
source share
2 answers

I understood! Looking at this, and another answer to another question, I found a solution.

In the controller you want to press jump, use this code:

[UIView transitionWithView:[[self navigationController] view]
                  duration:0.3
                   options:UIViewAnimationOptionTransitionFlipFromRight
                animations:^{
                    [[self navigationController] pushViewController:theView animated:NO];
                } completion:NULL];

, :

[UIView transitionWithView:[[self navigationController] view]
                  duration:0.3
                   options:UIViewAnimationOptionTransitionFlipFromLeft
                animations:^{
                    [[self navigationController] popViewControllerAnimated:NO];
                } completion:NULL];

tabBar. !

+1

, tabBarObject, , .

, , .

0

All Articles