让我们说我们有一个UIViewController
嵌入在UINavigationController
,UIViewController
segue到另一个UIViewController。
第二个UIViewController
有标准的左导航按钮,“解开”前面的UIViewController
。
我似乎无法通过故事板将右手按钮(使用UIBarButtonItem
)添加到第二个UIViewController
的导航栏,当我尝试此按钮时,按钮最终在UIViewController
的底部创建一个标签栏(请参阅下面,注意左边的按钮也不见了)。我缺少一些技巧吗?
我可以在自己的UIViewController
中嵌入第二个UINavigationController
,但后来我失去了后退按钮的功能。
我知道可以在代码中添加按钮,这样如果我尝试了一些可能的东西,一切都不会丢失。
要在故事板中执行此操作,您需要将UINavigationItem
放置在UIViewController
上。然后你可以添加你的UIBarButtonItem
(s)。