Navigation Bar is displaying at the bottom - iphone

as you can see from the picture i have added, my navigation bar is displaying at the bottom of the screen under my table view. I have just dragged and dropped my navigation bar on to that view controller which means i'm not using a navigation controller. I don't understand why this is happening and i'm sure its a simple fix which i am missing.
image 2 is the storyboard view
image 3 view of the app running
Any help is much appreciated, Thanks!

Delete your old navigation bar
Select your TableViewController and on top click editor->Embed in-> Navigation Controller
Now you should have a navigation bar on top.

See screenshot. You dragged a navigation bar into your table. To achieve the behavior you want you can embed your view controller inside a UINavigationController and access your navigation bar via self.navigationController.navigationBar.

I got your problem
What you have done is you have taken your navigation bar inside tableview...
that is the problem..
you just dragged that navigation bar outside that tableview...and that's it..

Related

Animate NavigationController transition without animating navigation bar

I have a typical ios app with a navigationcontroller. The navigation bar on the top has left and right buttons that stay the same through different views, so I would like to animate just the current view and not the top bar.
I'm not sure how to get started with this.
I've got an idea.
First, add your custom navigation bar on the top of the main view.
Second, add a navigationController as a subview under your navigation bar.
Now if the navigationController do the pushing or popping, your navigation bar will not change at all.

How to set the position of a Navigation Bar programmatically

How to set the position of a Navigation Bar programmatically? Autolay have been turned off as its causing issues in other IOS. Cheers guys.
[my layout]
View Controller
View
Toolbar
WebView
Navigation Bar
Nav Item
First Responder
Exit
Navigation bar is currently appearing at the bottom of the screen not the top where I want it.
Try this
[self.navigationController.navigationBar setFrame:CGRectMake(x,y,width,height)];
If you are using Interface Builder you can simply drag the navigation bar to where you want it

Navigation Controller with static table cells?

I'm trying to add a view that is a form that has 3 elements. These elements will be inside of a static grouped table. I need a navigation bar at the top with a "Save" and "Cancel" button. Both buttons should send the user back to their previous screen when tapped.
Within the storyboard, I have tried creating a Navigation Controller and then adding a table to it, but I get the error of "Static table view are only valid when embedded in UITableViewController".
So, I tried creating a Table View Controller, but the storyboard won't let me put a navigation bar into one of those for some reason...
What is the best way to go about doing this?
Add UITableViewController to your storyboard and then choose Editor > Embed in > Navigation Bar Controller from the menu. This will wrap your table view controller in a nav bar controller and you can then add your Save and Cancel buttons to the navigation bar.
It might seem a bit wasteful to create a navigation controller with only a single sub-controller just to get a navigation bar but it's the accepted way of doing it.
Oh... this iOS stuff is hurting my head.
I wanted to do the same thing, have a TableView, with a Navigation Bar at the top, but there was no "Embed in.. Navigation Bar" menu item, just "Embed in.. Navigation Controller".
Eventually, solving this was easier than I thought.
I just needed to add a Table View Controller to my storyboard, then CTRL+drag a Segue from the "calling" view controller to my new Table View Controller, and, voila, it gives me the Navigation Bar straightaway.

UISearchBar displays in the root view but not in any other view on the tab bar

I have implemented the search bar for the table in the first tab and this works fine and filters fine, however, with the same code and the xib linked up all the same etc on the second tab it no longer displays the search bar. Is there a simple reason to this?
Separate out the UISearchBar into its own class and then call it from the multiple views. It is not meant to be reinstantiated for each view controller.
Yes, there is a simple reason—the search bar is a subview of your main view, so when that view gets swiped off screen, it disappears with that view. To fix this, you'll have to add the search bar to the view that holds your tab bar controller—you'll probably have to put it in MainWindow.xib. You can still connect it to your tab bar controller if you need to—just add a reference to in the XIB.

Creating the view with Interface Builder, when using Navigation Controller

I'm creating an UIViewController in IB. And I want to use this controller with a UINaviagationController.
The problem is when I use this view controller with the navigation one the title bar appears and all the elements on view go down. Ho can I take account of this when creating the controller in IB ?
PS: Now, I just put everything a bit higher. But I don't think it's a right way.
In IB select the view controller view, open the inspector, select the View Attributes tab, and on Top Bar specify "Navigation Bar". This will make a Navigation Bar in the view and then you'll be able to place your subviews in the remaining content.
In the same way you can inform IB if your view will contain the status bar, the tab bar, a prompt.