• <small id='RsllA'></small><noframes id='RsllA'>

    <legend id='RsllA'><style id='RsllA'><dir id='RsllA'><q id='RsllA'></q></dir></style></legend><tfoot id='RsllA'></tfoot>
    <i id='RsllA'><tr id='RsllA'><dt id='RsllA'><q id='RsllA'><span id='RsllA'><b id='RsllA'><form id='RsllA'><ins id='RsllA'></ins><ul id='RsllA'></ul><sub id='RsllA'></sub></form><legend id='RsllA'></legend><bdo id='RsllA'><pre id='RsllA'><center id='RsllA'></center></pre></bdo></b><th id='RsllA'></th></span></q></dt></tr></i><div id='RsllA'><tfoot id='RsllA'></tfoot><dl id='RsllA'><fieldset id='RsllA'></fieldset></dl></div>
      <bdo id='RsllA'></bdo><ul id='RsllA'></ul>

        如何将模态转场(以编程方式)设置为推送转场

        时间:2023-06-13
          <bdo id='8LYb3'></bdo><ul id='8LYb3'></ul>

            <small id='8LYb3'></small><noframes id='8LYb3'>

            <i id='8LYb3'><tr id='8LYb3'><dt id='8LYb3'><q id='8LYb3'><span id='8LYb3'><b id='8LYb3'><form id='8LYb3'><ins id='8LYb3'></ins><ul id='8LYb3'></ul><sub id='8LYb3'></sub></form><legend id='8LYb3'></legend><bdo id='8LYb3'><pre id='8LYb3'><center id='8LYb3'></center></pre></bdo></b><th id='8LYb3'></th></span></q></dt></tr></i><div id='8LYb3'><tfoot id='8LYb3'></tfoot><dl id='8LYb3'><fieldset id='8LYb3'></fieldset></dl></div>
            <legend id='8LYb3'><style id='8LYb3'><dir id='8LYb3'><q id='8LYb3'></q></dir></style></legend>

                <tbody id='8LYb3'></tbody>
              <tfoot id='8LYb3'></tfoot>

                • 本文介绍了如何将模态转场(以编程方式)设置为推送转场的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我的故事板中有一个导航控制器,但出于一个原因,我必须以编程方式制作一个 segue,但我如何以编程方式制作一个 push segue?

                  i have an navigation controller in my storyboard, but for one reason i have to make one segue programmatically, but how do i make a push segue programmatically?

                  这是我目前的代码:

                  - (IBAction)nextviewButton:(id)sender {
                      HolesViewController *Holes = [self.storyboard instantiateViewControllerWithIdentifier:@"HolesViewController"];
                      Holes.nameString = self.NameField.text;
                  
                      [self presentViewController:Holes animated:YES completion:nil];
                  }
                  

                  推荐答案

                  另外,我实际上更喜欢在我的故事板中定义一个 segue,但不是源自按钮,而是源自视图控制器本身,例如:

                  Alternatively, I actually prefer to define a segue right in my storyboard, but rather than originating from the button, I have it originate from the view controller itself, e.g.:

                  然后,给该 segue 一个storyboard id",说Details",然后您可以通过以下方式以编程方式调用该 segue:

                  Then, give that segue a "storyboard id", say "Details", and then you can invoke that segue programmatically via:

                  [self performSegueWithIdentifier:@"Details" sender: ...]; // you can specify either the button or `self` for the `sender
                  

                  我喜欢这样,因为这样,故事板继续在视觉上代表应用程序的流程(而不是可能有没有转场的场景漂浮在那里).您可以对 push 和 modal segues 使用完全相同的结构(并且呈现下一个视图控制器的视图控制器并不关心情节提要使用哪一个).

                  I like this because that way, the storyboard continues to visually represent the flow of the app (as opposed to possibly having scenes floating out there with no segues). And you can use the exact same construct for both push and modal segues (and the view controller that's presenting the next view controller doesn't care which one the storyboard uses).

                  这篇关于如何将模态转场(以编程方式)设置为推送转场的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:以编程方式快速更改导航栏的高度 下一篇:如何一次弹出模态视图和前一个导航控制器视图?

                  相关文章

                    <bdo id='nqfB3'></bdo><ul id='nqfB3'></ul>
                  <legend id='nqfB3'><style id='nqfB3'><dir id='nqfB3'><q id='nqfB3'></q></dir></style></legend>

                  <small id='nqfB3'></small><noframes id='nqfB3'>

                • <i id='nqfB3'><tr id='nqfB3'><dt id='nqfB3'><q id='nqfB3'><span id='nqfB3'><b id='nqfB3'><form id='nqfB3'><ins id='nqfB3'></ins><ul id='nqfB3'></ul><sub id='nqfB3'></sub></form><legend id='nqfB3'></legend><bdo id='nqfB3'><pre id='nqfB3'><center id='nqfB3'></center></pre></bdo></b><th id='nqfB3'></th></span></q></dt></tr></i><div id='nqfB3'><tfoot id='nqfB3'></tfoot><dl id='nqfB3'><fieldset id='nqfB3'></fieldset></dl></div>
                  <tfoot id='nqfB3'></tfoot>