xcode 如何删除故事板中的导航控制器?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24954394/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 05:16:33  来源:igfitidea点击:

How to remove a navigation controller in storyboard?

xcodestoryboardswift

提问by Kokodoko

I am following a simple swift tutorial that shows how to add a navigation controller to a viewcontroller in storyboards in xcode. This is done using Editor > Embed in > Navigation Controller

我正在关注一个简​​单的 swift 教程,该教程展示了如何将导航控制器添加到 xcode 故事板中的视图控制器。这是使用 Editor > Embed in > Navigation Controller 完成的

enter image description here

在此处输入图片说明

The problem is, once the navigation controller is embedded, it cannot be removed. The 'unembed' option is always greyed out. Removing the controller view from the storyboard results in an error. Even if the arrow indicating the first view is pointing to a simple empty view in exactly the same way as when you're starting a new project.

问题是,一旦嵌入了导航控制器,就无法将其删除。'unembed' 选项总是灰显的。从故事板中删除控制器视图会导致错误。即使指示第一个视图的箭头以与开始新项目时完全相同的方式指向一个简单的空视图。

I would expect that there is still some code from the Navigation Controller lingering around somewhere, but how to pinpoint it?

我希望导航控制器中仍有一些代码在某处徘徊,但如何查明它?

采纳答案by Max

I follow this step.

我按照这一步。

1) select navigation controller and delete connection.

1) 选择导航控制器并删除连接。

select navigation controller

选择导航控制器

2) make root view to your view controller

2)为您的视图控制器制作根视图

make root view

制作根视图

root view

根视图

回答by preetam

No...there is no source code, don't worry.

不...没有源代码,别担心。

If your changes are hot then just Control-Z if not select navigation controller and press delete button.

如果您的更改很热,则只需 Control-Z 如果不选择导航控制器并按删除按钮。

回答by Richter

"unembed" function is for unembedding the "stack" in stackView and not for "navigation controller" nor "tab bar controller"

“unembed”函数用于在stackView中取消嵌入“stack”,而不是“navigation controller”或“tab bar controller”