简体   繁体   中英

Toolbar disappears after segue - Swift

When using a segue from a slide out menu to other view controllers, my toolbar and navigation bar both disappear. I fixed the navigation bar disappearing by segueing to a navigation controller, which then set the desired view controller as the root of the navigation controller. However this does not fix the toolbar issue. Should this not have fixed the toolbar disappearing as well? Either way, what is the best solution to my issue? Thanks!

I have had this problem using SWRevealViewControllerLibrary. In your storyboard make sure you are using "Reveal View Controller Push Controller" segue. If you have multiple segues, when you click on them you may find some things like the toolbar disappearing from the storyboard. If so then simply make a new one in the storyboard.

As for the second part of the question, from what I can tell toolbars are not by default part of a navigation controller's 'root' view, and so may change across controllers - just like how if you created a button or label in your first view, they would also change.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM