UINavigationController animated view but not title

Is there a way to navigate through the views in the navigation controller without animating the header?

I am creating an application that asks questions to users, when they click the next, a new question is entered into the NavigationStack and animated. But the title is also animated. The title in the title bar does not change, so is there a way to stop the animation of the title?

thanks

+4
source share
4 answers

You can use paged UIScrollView instead of UINavigationController . Customize your view in IB using the UINavigationBar top and bottom right, place a UIScrollView and ask the user to view your questions in this way.

0
source

You can stop the animation with

 // Pass the selected object to the new view controller. [self.navigationController pushViewController:detailViewController animated:NO]; 

and make sure you select the title for the pushed view controller (the same) the correct title; for example, in the detailed viewDidLoad view viewDidLoad do:

 self.title = @"title"; 

Now you can add a custom initWithTitle: , say, to your detailed view manager custom class to pass the title you need to set if the title needs to change, and not as you mention in your question.

Hope this helps.

0
source

I had the same problem (in my case, I have the same header in every child element that I add to the nav controller, so the name animation looks funny)

I solved this by adding a header directly to the nav controller and setting the header of the child controllers to nil

 UINavigationController *nav_controller; UILabel *lbl_title = [[UILabel alloc] initWithFrame:...] // Modify your title here [nav_controller.view addSubview:lbl_title]; UIViewController *vc_child; vc_child.title = nil; 
0
source

I do not think there is a direct solution to this problem. But I feel that this is achievable. You can have one navigation controller. When you click the next view from the navigation controller, you may have to hide from some custom animations.

What you can do, I think you can add the following view as a subview in a frame where

 x = 350( anything beyond the view frame ie 320, assuming iphone) , y = 0 , width = 320 and height = view height - 20 (20 is the height of navigation bar) 

you can add your next view as a sub-view to an existing navigation controller instead of clicking on the view from the navigation controller and giving some custom animations to the view when changing x values ​​from 350 to 0.

It will look like you click on a view, but you just create its effect by adding as a preview.

Hope this can provide an approach to your solution.

0
source

All Articles