菜鸟教程小白 发表于 2022-12-11 22:25:25

ios - 在 UISplitView 中跨多个详细 View 维护弹出窗口


                                            <p><p>在我的应用委托(delegate)中,我创建了一个 UISplitViewController。我将委托(delegate)设置为 detailViewController。</p>

<p>当我纵向运行我的应用程序时,我会显示左上角的弹出按钮,该按钮将滑出 Split View母版。</p>

<p>然后我的详细 View 中有一个按钮,它使用新的详细 ViewController 重置 splitviewcontroller 数组并将 Split View委托(delegate)设置为该 Controller 。</p>

<p>第二个详细 View 正确显示...但我丢失了第二个 ViewController 上的弹出按钮。</p>

<p>有谁知道如何让该按钮保留在我可能添加的所有细节 ViewController 上?</p>

<p>谢谢! </p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>见 <a href="http://www.raywenderlich.com/forums/viewtopic.php?f=2&amp;t=1546" rel="noreferrer noopener nofollow">http://www.raywenderlich.com/forums/viewtopic.php?f=2&amp;t=1546</a>我认为这是一个很好的方法。</p>

<p>它涉及将SplitViewController 委托(delegate)设置为master 而不是detail。 master 保持对 popoverController 和按钮的引用,每次调用委托(delegate)方法(隐藏和显示 master)时,它都会获取当前的详细 View 并执行必要的操作(添加按钮/删除按钮和 popovercontroller)。</p>

<p>master 为 "SubstituableDetailView"定义了一个协议(protocol),其中包含显示/隐藏按钮的两种方法。</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 在 UISplitView 中跨多个详细 View 维护弹出窗口,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/9996036/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/9996036/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 在 UISplitView 中跨多个详细 View 维护弹出窗口