1. <tfoot id='AI5Jt'></tfoot>

      <legend id='AI5Jt'><style id='AI5Jt'><dir id='AI5Jt'><q id='AI5Jt'></q></dir></style></legend>

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

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

      将 UIPopoverController 呈现在相同位置,仅更改箭头

      时间:2023-05-30

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

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

          2. <tfoot id='HFrlI'></tfoot>

                本文介绍了将 UIPopoverController 呈现在相同位置,仅更改箭头偏移量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我的目标是保持 UIPopoverController 的坐标相同,只需更改箭头偏移量.所以基本上我有三个按钮触摸它们中的每一个都会显示一个弹出窗口.呈现此弹出框时,它会更改屏幕上的位置,但我不希望那样.为了更清楚地查看屏幕截图:

                My goal is to keep same coordinates for a UIPopoverController with just changing arrow offset. So basically i have three buttons touching each of them shows up a popover. When presenting this popover it changes position on the screen, but i do not want that. To be more clear look at screenoshots:

                推荐答案

                对于我的弹出框,我希望箭头位于左上角而不是顶部居中(这是默认设置).

                For my popover I wanted the arrow to be top-left instead of top-center (which is default).

                通过设置 UIPopoverController 的 popoverLayoutMargins 属性,我设法得到了下面的结果(屏幕截图).您可以使用它来减少 UIPopoverController 内部计算中使用的屏幕区域,以确定在何处显示弹出框.

                I've managed to get the result below (screenshot) by setting the popoverLayoutMargins property of the UIPopoverController. You can use it to reduce the screen-area used in the internal calculations of the UIPopoverController to determine where to show the popover.

                代码:

                // Get the location and size of the control (button that says "Drinks")
                CGRect rect = control.frame;
                
                // Set the width to 1, this will put the anchorpoint on the left side
                // of the control
                rect.size.width = 1;
                
                // Reduce the available screen for the popover by creating a left margin
                // The popover controller will assume that left side of the screen starts
                // at rect.origin.x
                popoverC.popoverLayoutMargins = UIEdgeInsetsMake(0, rect.origin.x, 0, 0);
                
                // Simply present the popover (force arrow direction up)
                [popoverC presentPopoverFromRect:rect inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
                

                我认为您可以通过调整上述内容来获得所需的结果.

                I think you'll be able to get the desired result by tweaking the above.

                这篇关于将 UIPopoverController 呈现在相同位置,仅更改箭头偏移量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:iOS:UISplitViewController 无法推送到 UINavigationControl 下一篇:performSegueWithIdentifier 和 sharedData

                相关文章

                最新文章

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

                  <small id='4ITP4'></small><noframes id='4ITP4'>

                  <tfoot id='4ITP4'></tfoot><legend id='4ITP4'><style id='4ITP4'><dir id='4ITP4'><q id='4ITP4'></q></dir></style></legend>
                    <bdo id='4ITP4'></bdo><ul id='4ITP4'></ul>