Before I added the navigation controller to storyboard, the program still worked. After I added the navigation bar to project, when I clicked the button from the homepage,it is supposed to link to the first page but, it can't and displays the black background. For the program, I just set the title for the view controller. What's the problem? Should I need to add some code to solve?
Asked
Active
Viewed 69 times
0
-
if you're wanting to have a navigation for the bar, you can go to storyboard, click on the VC (without the added nav bar), then go to Editor -> Encase (or Enclose maybe) -> Navigation Controller and that will add a nav bar for you, and will give you the ability to do navigation controls – user2277872 Feb 18 '14 at 15:18
1 Answers
0
First you need to confirm yourself whether your are adding NAVIGATION CONTROLLER or NAVIGATION BAR to storyboard.If you are going to add NAVIGATION CONTROLLER TO VIEW CONTROLLER,you should set
1.PUT NAVIGATION CONTROLLER IN STORYBOARD(FROM UTILITY AREA)
2.WHEN YOU DRAG THE NAVIGATION CONTROLLER(FROM UTILITY AREA),SIMULTANEOUSLY YOU WILL HAVE A TABLE VIEW CONTROLLER WITH NAVIGATION CONTROLLER.
3.ONCE YOU PUT IN STORYBOARD,YOU SHOULD CLICK TABLE VIEW CONTROLLER AND DELETE THE TABLE VIEW CONTROLLER.
4.CONNECT NAVIGATION CONTROLLER WITH VIEW CONTROLLER(YOU SHOULD GIVE RELATIONSHIP AS ROOT).
If u follow above methods,you will never get confused.You can get relevant answer.
And now if you are going to add NAVIGATION BAR TO VIEW CONTROLLER YOU JUST SEE the following things
1.After the above process ADD NAVIGATION BAR IN VIEW CONTROLLER PART(HEADER OF THE VIEW CONTROLLER)
2.GIVE TITLE(WHATEVER YOU WANT) IN THE MIDDLE OF THE NAVIGATION BAR
Now it will see your required part.

user3182143
- 9,459
- 3
- 32
- 39