[英]How to build navigation controller from existing view controllers drew in storyboard?
I have built some view controllers in storyboard like in the picture below 我在故事板中构建了一些视图控制器,如下图所示
I already implemented the data inside them, modal segue is used for transitions in between. 我已经在其中实现了数据,模态segue用于两者之间的转换。 Now I just realise when I push "back" button, previous view won't be properly loaded.
现在我只是意识到当我按下“后退”按钮时,前一个视图将无法正确加载。 I figure I should switch to navigation controller and add those controllers in stack instead.
我想我应该切换到导航控制器并将这些控制器添加到堆栈中。 But I don't know how to go from where I am now.
但我不知道如何离开我现在的位置。
I think I should make changes programmatically because I found building navigation controller in storyboard won't have much variation in UI design (at least I don't know how to implement existing pages in that way). 我想我应该以编程方式进行更改,因为我发现故事板中的建筑导航控制器在UI设计中不会有太多变化(至少我不知道如何以这种方式实现现有页面)。 So what should I do to implement programmatically?
那么我该怎么做才能以编程方式实现呢? Please help me, thanks!
请帮帮我,谢谢!
Select Category View Controller and go to menu: Editor > Embed In > Navigation Controller. 选择Category View Controller并转到菜单:Editor> Embed In> Navigation Controller。 Then change segues style from Modal to Push.
然后将segue样式从Modal更改为Push。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.