Reputation: 521
I have been searching around the internet for this solution, but I'm giving up and have to ask a question now.
I have made a navigationController and when I try to add an extra NavigationBar it just allign in the tableview? (Photos underneath)
On the photos you will see that I have a navigationbar at the bottom, but it doesn't appear when I run the app.
How can this be?
Best regards Alexander
Upvotes: 1
Views: 105
Reputation: 1021
It seems like you're mostly having problems with auto layout. Add a regular UIView as the tableHeaderView, place your navigationBarThere then hit reset to suggested constraints.
The auto-layout button looks like a triangle between two bars. Select your view controller in the storyboard, then click it. You can see a picture of it below:
Upvotes: 1
Reputation: 1506
Run the app on the simulator and use the debug view hierarchy feature of Xcode to locate the nav bar and view its properties to determine what is causing it to disappear.
In response to your question below, while the app running in the sim and you on interface builder the button should be at the bottom. You might want to read about it here as well: Debugging Views
Upvotes: 1
Reputation: 2471
Dont add another navigation bar , Instead add toolBar at the bottom , you can then add barbutton items to it . If it doesnt appear on screen on running the app (the bottom toolbar) just create an outlet of the toolbar in viewcontroller.swift and then do this
@IBOutlet var toolbar: UIToolBar!
override func viewDidLoad() {
super.viewDidLoad()
toolbar.layer.zPostion = 5 // big values are on top. You can use any values you want, including negative values." The default value is 0.
}
Upvotes: 1