Clement Bisaillon
Clement Bisaillon

Reputation: 5177

My navigation bar is in my TableView - Swift

I have a TableViewController and i wan't to put a navigation controller but if i drag and drop it in my view, the navigation controller act like a cell

Is there a way to put it on top of the tableView?

I have tried putting the view in a navigation controller and it's working but i don't want to use a navigation controller

Upvotes: 2

Views: 3865

Answers (2)

newbie
newbie

Reputation: 21

You can try to add a Navigation Item to the tableViewController. Make sure that it has Segue connected to the tableViewController. Otherwise, the Navigation Item may not be visible. Once done that, you can add the Bar Button Item to the Navigation Item.

Upvotes: 1

Ezimet
Ezimet

Reputation: 5078

You should add the navigationBar to a viewController not a tableViewController , if you want navigationBar without navigationViewController , add navigationBar to a viewController and then add the tableView on top of it .tableViews top edge should align to the navigation bar`s bottom edge. I test this , and it worked .

Upvotes: 2

Related Questions