" present如酥料饼"塞格斯和视图大小 [英] "Present as Popover" segues and view size

查看:158
本文介绍了" present如酥料饼"塞格斯和视图大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以点任何指导/文档上的项目应如何放置在这样的组件适当定位,自动布局将显示为酥料饼视图控制器?

Can anyone point to any guidance/documentation on how items should be placed in a view controller that will be displayed as a popover so that the components are appropriately positioned with auto layout?

具体做法是:我在第X code 8.3的工作与新的present如酥料饼SEGUE,随着新的万能故事板。我添加了一个视图控制器,然后一酥料饼SEGUE到该视图控制器。当显示它,我看到大致视图控制器左上象限显示为酥料饼,但没有自动布局出现,据我可以看到,以适应iPad的酥料饼的尺寸略有不同将发生VS对不同尺寸的iPhone手机全屏幕的行为 - 因此,实际上,视图控制器的略有不同部分在不同设备上是可见的。

Specifically: I'm working in Xcode 8.3 with the new "Present as Popover" segue, with the new "universal" storyboards. I add a view controller and then a popover segue to that view controller. When it is displayed, I see that roughly the top-left quadrant of the view controller is displayed as a popover, but that no auto layout appears to be taking place as far as I can see to accommodate the slightly different sizes of an iPad popover vs "full screen" behaviour on the different sized iPhones -- so in effect, a slightly different section of the view controller is visible depending on the device.

我想这是不是真的事情是如何工作的,和通用酥料饼SEGUE的整个存在的理由是恰当适合的东西通过自动布局酥料饼的大小?因此,谁能阐明我在做什么错误或弹出窗口应该如何相对于工作,自动布局一些轻?

I assume this isn't really how things are supposed to work, and the whole raison d'être of the universal popover segue is to appropriately fit things to the popover size via auto layout? So can anyone shed some light on what I'm doing wrong or how popups are supposed to work with respect to auto layout?

推荐答案

有得看与popovers是,在iPad等设备,为酥料饼的大小类是不一样这引起了它的控制器。

Something to watch for with popovers is that on devices like the iPad, the size class for the popover is not the same as the controller which raises it.

您可能会发现大小类从常规宽度变为紧凑的宽度,当您使用在iPad上一酥料饼。如果您有布局coded到正规的宽度为您酥料饼的内容,那么就不会在酥料饼工作。

You will probably find that the size class goes from regular width to compact width when you use a popover on an iPad. If you have layout coded to regular width for your popover content, then it will not work in the popover.

酥料饼本身的尺寸来自用于控制器presented内容大小的属性。您可以在属性检查器视图控制器或code明确设置它的大小。请参阅:如何正确present酥料饼中的iOS 8

The size of the popover itself comes from the content size properties for the controller presented. You can set this size explicitly in the attribute inspector for the view controller or in code. See: How to present popover properly in iOS 8

这篇关于" present如酥料饼"塞格斯和视图大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆