present modal view hides the navigation bar in navigation stack - ios

I have spent hours on this wired problem.
The scenario is I have push a new chatting view controller to the root navigation controller.
Then I customized the navigation bar item in the viewdidload method.
Everything works fine.
Then I present a image picker view which enables the image upload function.
And dismiss that picker view, which was presented as modal view.
After the picker view dismissed, the customized left navigation bar button disappeared.
The navigation bar appearance is the same as the root navigation bar but not the customized appearance is the current view controller.
Because the some pieces of the work includes the third party SDK, so I am not able to directly change the UIPickerView in order to detect the dismiss event and change the navigation bar appearance.
Can anyone helps? Thank you so much.

You should removed customised the navigation bar item on viewWillDisappear and add this viewWillAppear instead of viewDidLoad

Related

set up status bar text color of a UINavigationController that is presented modally from a modal

I have a modal view controller whose navigation controller's bar style is "UIStatusBarStyleBlack", so its status bar text color is white.
However, if I present a UINavigationController modally from here and I want it to be have a bar style of "UIStatusBarStyleDefault", I can't control the status bar text color.
I've tried everything suggested on SO (subclass, extensions, etc), but none of the solutions take this scenario into account (modal on a modal).
EDIT: This seems to only be the issue whenever it is presented from a non-fullscreen modal. So, if the first modal was fullscreen, everything works. But if it was a form sheet or popover on iPad, then the modal presented from there won't update the status bar color.
I think the problem is that you are presenting your view controller instead of a navigation controller.
First you need to create a navigation controller with root view controller as your view controller and then present that navigation controller.
If this is not the case then kindly post some code which shows how exactly you are currently approaching the case.

iOS Navigation Controller doesnt add navigation bar

My situation: http://i.stack.imgur.com/KTlVu.png
I have two views right now. From the second view, I want to have a back button that goes back to the initial view. I added a navigation controller and made it the initial view, and the navigation bar appeared for the first view(PlusCalendar). However, I don't know how to add a navigation bar for the second view(AddEventControllerVC) and add a back button that makes it go back to PlusCalendarView. I have looked at several tutorials and none of them surprisingly dealt with this problem. I am also looking at Apple's class reference and I am not sure if I have to initialize the navigation bar again from the second view controller. My questions are..
How come a navigation bar is not automatically added to all of my views?
For the second view, why does the navigation bar seem to be placed at the bottom?
How do I add a navigation bar on top of the second view, and add a "back" button?
The navigation bar was supposed to add the back button automatically. The problem was that the sigue between my first view and second view was set as a "modal popover." When I changed it to a "push" the back button appeared rightfully.
It seems that in model pop, the navigation bar is not record the view controller in its stack. So it cannot known the back track.In your case ,you should custom your navigation items in the second view controller. You can look this example: custom navigation bar

Show UITabBar while presenting a modal view

When a user taps on a UITabBar item, I would like to present a view controller modally, but I would also like the UITabBar to remain visible. When the user is finished with the modal view controller I want to dismiss it modally. Basically, I want to show one view controller on top of another and dismiss the top view controller with a modal animation, while keeping the UITabBar visible. I am thinking I have to do some sort of custom animation, but I cannot figure out how to make that work.
Anyone know how to do this for iOS 6 and iOS 7?
Modal segues coverup the previous navigation controller stack, so any existing tab, navigation, and tool bar controllers will no longer accessible. You'll either need to use a push segue to retain the existing tab bar, or add a new tab bar controller to the modal view.

Modal Segue Into Navigation Controller with No Nav Bar

In my storyboard I have a view with a segue into a new view that's embedded into a Navigation Controller (so the segue points to the navigation controller). I have the segue set to a Modal transition, however when the new view is animating up, it contains the standard blue navigation bar above the view (which then animates out of view).
Here's what it looks like mid segue: http://i.imgur.com/3eqAQ.png
How do I make it so the modal view animates up but without the navigation bar?
I have tried hiding the navigation bar in the embedded view's init, viewWillAppear, and vieWillLoad methods and that doesn't work.
I event went so far as to create a custom subclass of UINavigationController and set the navigation controller in the storyboard to it.
Thanks!
This may sound pretty simple, but have you tried hiding the navigation bar immediately before the modal segue starts? I had this problem when presenting a modal view controller and adding a [self.navigationController setNavigationBarHidden:YES] immediately before the presentation did the trick for me.
I had almost the same problem, but I wanted to get a navigation bar for my modal transition, as it was always hidden.
There may be two ways for you to remove the navigation bar:
Make sure that your view controller is not embed in a navigation controller, as it would put one by default
Check the "Top Bar" attribute of your previous controller in the workflow and work with none/inferred values depending on your storyboard.
Regards

Change from one navigation controller to another

I have application with 2 tab bars. In second tab bar I have navigation controller. I want to change this navigation controller to another navigation controller when "Change" button is pressed. How can I do that? Please help me.
Thanks
You'd have to replace the View Controller in the TabBar using the viewControllers property of UITabBarController or setViewControllers:animated:if you want to add some animation.
But maybe you should think of having 2 views in a controller of yours and hide/show them when you click a button, maybe even pushing/popping view controllers without animation (pushViewController:yourController animated:NO) on the navigation stack of your navigation controller and just hide the back button (self.navigationItem.hidesBackButton = YES)

Resources