【问题标题】:UIViewImage push to new UIViewController IN STORYBOARDUIViewImage 推送到故事板中的新 UIViewController
【发布时间】:2013-07-31 15:43:57
【问题描述】:

thisthis 之类的问题中,我知道如何以编程方式将UIViewImage 推送到新的UIViewController

但我怎样才能完全在 Storyboard 中做到这一点?我喜欢 Storyboard,并且不希望到处都有多个 xib 文件。

我已经通过 Storyboard 启用了用户交互,但我仍然无法创建过渡...

【问题讨论】:

    标签: ios uiimageview uistoryboard uistoryboardsegue


    【解决方案1】:
    1. 将 UIViewController 对象拖到 Storyboard 画布上
    2. 选择该 ViewController 并在顶部菜单栏中单击编辑器 > 嵌入 > 导航控制器。
    3. 将另一个 UIViewController 拖到 Storyboard 上
    4. 控制从第一个 UIViewController 拖动到新的 UIViewController 并从结果选项中选择 push。
    5. 单击创建的 Segue,然后转到属性检查器并输入 Segue 的标识符。
    6. 在处理 UIImageView 轻击的 ViewController 代码中,调用 [self performSegueWithIdentifier:@"YourSegueIdentifier" sender:self];

    【讨论】:

    • 非常感谢!这似乎正是我正在寻找的。按照您的步骤操作后,我收到错误消息:“'MyFileName' 没有可见的@interface 声明选择器'performSegueWithIdentifier'”
    • 您可能需要在 Storyboard 中设置 ViewController 的适当类。选择 ViewController > 单击 Identity Inspector > 并将 ViewController 的类设置为您正在调用的类 performSegueWithIdentifier:
    • 我只需要将行更改为:“[self performSegueWithIdentifier:@"ClickOnConnect" sender: self];"感谢您的帮助!
    • 抱歉,我忘记了“发件人”的说法!
    猜你喜欢
    • 1970-01-01
    • 2014-11-18
    • 1970-01-01
    • 2011-12-12
    • 2023-03-05
    • 1970-01-01
    • 2012-09-30
    • 1970-01-01
    • 2012-02-11
    相关资源
    最近更新 更多