简体   繁体   English

无法使用Storyboard将条形按钮项目添加到详细视图控制器的navigationBar中?

[英]Can't add bar button item to navigationBar in detail viewController using Storyboard?

I am adding an item to navigationBar in Main viewController, it works well. 我在Main viewController中的navigationBar中添加了一个项目,它运作良好。 When I am adding an item to navigationBar in detail ViewController, I drag the item to ViewController, but it doesn't work, I can only add it to the top or bottom of the ViewController. 当我向ViewBar的详细导航栏添加一个项目时,我将该项目拖到ViewController,但是它不起作用,我只能将其添加到ViewController的顶部或底部。 And when I run the app, there is no item in the screen. 当我运行该应用程序时,屏幕上没有任何项目。

在此处输入图片说明

How can I add an item to navigationBar in detail ViewController by storyboard? 如何通过Storyboard在详细ViewController的NavigationBar中添加项目?

您需要为DetailsViewController添加NavigationItem,然后选择Bar Button Item,并将其拖动到刚添加的NavigationItem中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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