UIPopoverController - 位于缩放/滚动视图内的presentPopoverFromRect?

发布于 2025-01-07 19:20:39 字数 1396 浏览 1 评论 0原文

我有一个缩放/滚动 UIScrollview,我可以在上面放置视图(想想绘图对象、圆形、正方形等),我在上面放置一个正方形,然后点击并按住,出现菜单,然后我选择属性。我传入 Rect 的 square.frame,弹出框看起来很棒,适合 UIScrollView。

现在我缩放 UIScrollView ,使 Square 大于屏幕上的可见区域。点击并按住,选择属性,弹出窗口就会显示在某处,尽管不是我能看到的任何地方。

我不知道如何从 Square 的角度检测它是否大​​于 super.view 放大区域的可见区域,并从不同的 Rect 呈现 Popover。

缩小,正方形完全可见,并且在画布上有弹出窗口的空间

self.frame:                              {{0, 659.959}, {1846.72, 1388.04}}
self.superview.frame:                    {{0, 0},       {1024,    1024}}
self.superview.superview.frame:          {{0, 44},      {1024,    704}}
self.superview.superview.superview.frame:{{0, 0},       {1024,    748}}

放大,正方形覆盖整个屏幕

self.frame:                              {{0, 659.959}, {1846.72, 1388.04}}
self.superview.frame:                    {{0, 0},       {3180.31, 3180.31}}
self.superview.superview.frame:          {{0, 44},      {1024, 704}}
self.superview.superview.superview.frame:{{0, 0},       {1024, 748}}

最大缩放,虽然滚动,所以画布上有弹出窗口的空间

self.frame:                              {{0, 659.96}, {1822.62, 1369.96}}
self.superview.frame:                    {{0, 0},      {4096, 4096}}
self.superview.superview.frame:          {{0, 44},     {1024, 704}}
self.superview.superview.superview.frame:{{0, 0},      {1024, 748}}

最后一个脚趾似乎没有区别告诉我们该正方形覆盖了屏幕,而不是只有一小部分可见。

欢迎任何建议!

I have a scaling/scrolling UIScrollview that I can place views on (think Drawing objets, Circles, squares, etc) I place a square on there and tap and Hold, menu comes up and I select Properties. I pass in the square.frame for the Rect and the popover looks great where it can fit in the UIScrollView.

Now I scale the UIScrollView so that the Square is bigger than the visible area on the screen. Tap and Hold, select properties, and the Popover is Presented somewhere, though not anywhere I can see.

I'm not sure how to detect from the Square's perspective if its bigger than the visible area of the super.view's zoomed in area and present the Popover from a different Rect.

Zoomed Out, square is completely visible and has room for popover on canvas

self.frame:                              {{0, 659.959}, {1846.72, 1388.04}}
self.superview.frame:                    {{0, 0},       {1024,    1024}}
self.superview.superview.frame:          {{0, 44},      {1024,    704}}
self.superview.superview.superview.frame:{{0, 0},       {1024,    748}}

Zoomed In, square is covering all of screen

self.frame:                              {{0, 659.959}, {1846.72, 1388.04}}
self.superview.frame:                    {{0, 0},       {3180.31, 3180.31}}
self.superview.superview.frame:          {{0, 44},      {1024, 704}}
self.superview.superview.superview.frame:{{0, 0},       {1024, 748}}

Max Zoom, though scrolled so there is room for popover on canvas

self.frame:                              {{0, 659.96}, {1822.62, 1369.96}}
self.superview.frame:                    {{0, 0},      {4096, 4096}}
self.superview.superview.frame:          {{0, 44},     {1024, 704}}
self.superview.superview.superview.frame:{{0, 0},      {1024, 748}}

There does not seem to be a difference in the last toe to really tell that the square is coving the screen vs only a smidgin of it visible.

Any Suggestions welcome!

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

很糊涂小朋友 2025-01-14 19:20:39

这取决于弹出窗口控制器正在显示哪个视图,但您可以尝试使用以下命令将 Squares 框架从滚动视图转换为显示弹出窗口的视图

- (CGRect)convertRect:(CGRect)rect fromView:(UIView *)view

it depends on which view the popover controller is being displayed, but you could try converting the Squares frame from the scrollview to the view displaying the popover using

- (CGRect)convertRect:(CGRect)rect fromView:(UIView *)view
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文