简体   繁体   English

UIViewImage推送到故事板上的新UIViewController

[英]UIViewImage push to new UIViewController IN STORYBOARD

From questions like this and this , I know how to have a UIViewImage push to a new UIViewController programatically. 从这样的问题这个这个 ,我知道如何有一个UIViewImage推到一个新UIViewController编程。

But how can I do this in completely in Storyboard ? 但是,如何在Storyboard中完全做到这一点呢? I like Storyboard and would like to not have multiple xib files everywhere. 我喜欢Storyboard,并且希望到处都没有多个xib文件。

I've already enable User Interaction through Storyboard , but I still can't create a transition... 我已经通过Storyboard启用了用户交互,但是我仍然无法创建过渡...

在此处输入图片说明

  1. Drag UIViewController object onto your Storyboard canvas 将UIViewController对象拖到Storyboard画布上
  2. Select that ViewController and in the top menu bar, click Editor > Embed in > Navigation Controller. 选择该ViewController,然后在顶部菜单栏中,单击“编辑器”>“嵌入在”>“导航控制器”。
  3. Drag another UIViewController onto the Storyboard 将另一个UIViewController拖到Storyboard上
  4. Control drag from the first UIViewController to the new UIViewController and select push from the resulting options. 控制从第一个UIViewController拖动到新的UIViewController并从结果选项中选择push。
  5. Click on the Segue that is created and go to the Attributes inspector and enter an Identifier for the Segue. 单击创建的Segue,然后转到“属性”检查器,然后输入Segue的标识符。
  6. In the ViewController code where you're handling the UIImageView tap, call [self performSegueWithIdentifier:@"YourSegueIdentifier" sender:self]; 在要处理UIImageView点击的ViewController代码中,调用[self performSegueWithIdentifier:@"YourSegueIdentifier" sender:self];

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

相关问题 推新UIViewController带透明 - Push new UIViewController with transparency 在新的Storyboard中将值传递给UIViewController - Swift - Passing Values to UIViewController in new Storyboard - Swift 从Storyboard嵌入到容器视图中的UINavigationController不会推送UIViewController - UINavigationController embedded in container view from Storyboard won't push UIViewController 使用Storyboard Refrences时如何显示新的UIViewController - How do I present a new UIViewController when Storyboard Refrences are used 如何在故事板上创建一个Segue,从编程注册的UICollectionViewCell到新的UIViewController? - How to create a Segue on the Storyboard, from a programmatically registered UICollectionViewCell to a new UIViewController? UITabBarController在情节提要的上方添加新的UIViewController(Swift) - UITabBarController add new UIViewController above storyboard ones (Swift) 使用Storyboard本地化UIViewController - Localizing UIViewController using Storyboard 故事板中的UIViewController标题属性 - UIViewController Title attribute in Storyboard 无法将UIViewController重构到情节提要 - Not able to refactor UIViewController to storyboard XCode Storyboard和UIViewController实例化 - XCode Storyboard and UIViewController instantiation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM