0

I'm creating an application where I need to use two different navigation bars. When the application first opens up, the nav1 bar should be displayed with an image and a Login button .. when they login screen appears, there is no nav bar. After login, it goes to a Detail screen where I need to show a back arrow image, a screen title and a menu button with drop down options.

I'm using one View_Controller that all my Views inherit from. I've been working on this for days and I'm so lost, please help.

  • If you are trying to detect if the device is IOS, take a look at [this post](http://stackoverflow.com/questions/9038625/detect-if-device-is-ios) – starvator Sep 29 '14 at 17:43
  • sorry if i was not clear, I'm creating an IOS application where I need to implement two different navigation bars. I'm new to iOS and I'm not sure how to set a different nav bar for different views – SurfingViolinist Sep 29 '14 at 17:45
  • @starvator not entirely sure that has to do with the question. You have clearly misunderstood what is being asked. `SurfingVoilinist` What you want can be accomplished using a `UINavigationController` Not currently in a position I can give an answer so just google it. – Popeye Sep 29 '14 at 19:37

2 Answers2

0

I'm a little confused about the structure of your app.

As I understand it, you want an initial view that is contained in a UINavigationController. Once someone taps the "Login" UIBarButtonItem on the UINavigationBar, then you have a view come up that is not contained in a UINavigationController (probably because it is a modal view that is outside the navigation flow of your app).

The part I'm confused about is where the Detail view comes in. Is the modally presented view dismissed while the Details view is pushed onto the navigation stack from the initial view? Why does the Details view need a back button? Does going back to the initial view effectively log out the user?

At any rate, you should be able to change the UINavigationBar for every view that is pushed on to the stack (that is also contained in your UINavigationController). If you are using Storyboard, you need to make sure that you embed the views pushed on to the stack in a UINavigationController. You can do that by going to the "Editor" menu, selecting "Embed in" and then selecting "Navigation Controller".

Let me know if I didn't understand your question or if you can post more details.

Erik
  • 927
  • 11
  • 28
  • Hey Erik, i'm probably making it more confusing than I should, but simply put .. someone logs in and sees a bunch of deals (the nav bar has a logo and a login button) .. they click the login button and it goes to the login view (no nav bar) .. they login and it goes to a deal detail view (now nav bar has a back arrow-to go to all the deals, a title saying Deal Detail, and a Menu button with a drop down menu) .. i worked it out by having my master View_Controller reset the objects on the nav bar based on which view it is. – SurfingViolinist Sep 30 '14 at 21:51
0

Navigation bar will be the same in the app. You can hide it, show it, change title, change background color, or background image on each view depending on your requirements. But there is only one navigation bar in navigation based apps.

Fawad Masud
  • 11,427
  • 3
  • 23
  • 32