segue不适用于简单的segue测试 [英] segue does not work in simple segue test

查看:110
本文介绍了segue不适用于简单的segue测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的问题。我在故事板中创建了2个viewcontrollers: testSegueViewcontroller nextPageViewController

testSegueViewcontroller包含一个UIButton NextPage。我按住Ctrl键从这个按钮拖到nextPageViewController并创建了一个Push segue。

I have a weird problem. I have created 2 viewcontrollers in my storyboard: testSegueViewcontroller and nextPageViewController.
The testSegueViewcontroller contains a UIButton NextPage. I Ctrl-dragged from this button to nextPageViewController and created a Push segue.

问题是当我运行这个程序并单击testSegueViewcontroller中的NextButton时它没有显示nextPageVieController: - (

The problem is when i run this program and clicking on the NextButton in the testSegueViewcontroller it does not show the nextPageVieController :-(

我做错了什么想法?

推荐答案

使用这种方法你应该使用模态segue。推送segue是 UINavigationController 过渡的一部分

With this approach you should use modal segues. Push segue is a part of UINavigationController transitions

如果你想使用push然后你需要将你的 testSegueViewcontroller 放入 UINavigationController 实例。这将允许推送segue工作。

If you want to use push segue then you will need to put your testSegueViewcontroller into UINavigationController instance. This will allow the Push segue to work.

这篇关于segue不适用于简单的segue测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆