带有嵌入式导航控制器的弹出窗口可移动弹出窗口视图

发布于 2024-12-11 02:10:36 字数 723 浏览 5 评论 0原文

我使用此处解释的技术使弹出窗口视图大小在视图控制器之间切换时正确刷新:

带有嵌入式导航控制器的弹出窗口不考虑背面导航的大小

它工作正常......除了这一点:我用来调用弹出窗口的按钮位于窗户的右角。正如预期的那样,弹出窗口显示在其左侧。

因此,我们假设按钮位于框架 ( 900, 700, 40, 40 ) 中,并且第一个视图控制器为 200 x 200。

弹出窗口视图大约位于 (700, 500, 200, 200)。

如果我从该视图控制器推送另一个更大的视图(假设为 400x 400),则弹出窗口视图会适当调整大小,向左移动更多。

但是,当我“返回”(到 200x200 视图控制器)时,弹出窗口视图会调整大小,但它保持在左侧,因此它大约位于( 500, 500, 200, 200)。

换句话说,如果在视图层次结构中导航时有更宽的视图,它将向左扩展,而当返回时,它将从右侧缩小(有效地将内容移动到左侧)。

注意:对于令人困惑的解释感到抱歉。不太清楚如何解释这个问题。

顺便说一句:如果我将按钮放在视图的左侧,则完全相同的程序可以完美运行,因此弹出窗口被迫从一开始就向右增长 - 但是,营销人员希望按钮位于右侧。

I am using the technique explained here to make the popover view size refresh properly when switching between view controllers:

Popover with embedded navigation controller doesn't respect size on back nav

It works fine... except for this: the button that I use to invoke the popover is in the right corner of the window. Like expected the popover window is shown to the left of it.

So, let's assume that the button is in frame ( 900, 700, 40, 40 ), and the first view controller is 200 x 200.

The popover view is located approximately at (700, 500, 200, 200).

If from that view controller I push another bigger view (let's say 400x 400), the popover view resizes appropiatelly, moving more to the left.

However, when I go "back" (to the 200x200 view controller) the popover view resizes, but it stays on the left, so it is approximately located at ( 500, 500, 200, 200).

In other words, if when navigating through the hierachy of views there is a wider view, it will expand to the left, and when going back it will shrink from the right (effectively moving the content to the left).

Note: sorry about the confusing explanation. Didn't know really well how to explain this issue.

BTW: the exact same program works perfectly if I put the button on the left side of the view, so the popover is forced to grow to the right from the beginning - however, marketing wants the button on the right.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文