Adding buttons to navigation controllers

有些话、适合烂在心里 提交于 2019-12-26 06:04:27

问题


I am working in a swift 3 xcode 8 project, and I have an issue.

I have some view controllers. In the first one I've inserted a navigation controller, which gives me the "back" button when I am in another view controller. So I can go on and back to the first viewcontroller.

The thing is, lets say, when I am in the third view controller I'd like to insert a button, but appearing just in this viewcontroller in the navigation controller.

I've tried adding a bar button item but it doesnt work because the navigation controller only appears, in the storyboard, in my first viewcontroller.

So how can I add buttons to the navigation controller, in another viewcontrollerS?


回答1:


So how can I add buttons to the navigation controller, in another viewcontrollerS

Drag a Navigation Item into your third view controller. Now you can add bar button items to that.



来源:https://stackoverflow.com/questions/40286760/adding-buttons-to-navigation-controllers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!