[英]How to present an action extension in an action sheet rather than full-screen modal view?
According to the documentation , action extensions appear in an action sheet or full-screen modal view. 根据文档 ,操作扩展显示在操作表或全屏模式视图中。 But for IPhone portrait orientation it is always fullscreen by default.
但对于iPhone纵向方向,默认情况下始终为全屏。 How can I present the action extension view in an action sheet for the iPhone portrait orientation?
如何在iPhone纵向方向的操作表中显示操作扩展视图?
I have tried setPreferredContentSize
and NSExtensionActionWantsFullScreenPresentation
. 我尝试过
setPreferredContentSize
和NSExtensionActionWantsFullScreenPresentation
。 Both seems to have no effect in iPhone portrait orientation. 两者似乎都没有影响iPhone纵向。
There's no way for an action extension to be non-fullscreen on iPhone.* 在iPhone上,动作扩展无法成为非全屏。*
The alternative presentation when NSExtensionActionWantsFullScreenPresentation
is false is equivalent to UIModalPresentationFormSheet
. NSExtensionActionWantsFullScreenPresentation
为false时的替代演示等同于UIModalPresentationFormSheet
。 Form Sheet presentation is non-fullscreen only on iPad — it's the presentation style you see for things like composing a new message in Mail, or viewing app details in the App Store. 表单工作表演示文稿仅在iPad上是非全屏的 - 它是您在Mail中撰写新邮件或在App Store中查看应用程序详细信息等内容时所看到的演示文稿样式。 You can still choose form sheet presentation on iPhone,* but it behaves equivalent to fullscreen.
您仍然可以在iPhone上选择表单表示*,但它的行为与全屏相同。
* Well, sort of. 嗯,有点儿。 It's not actually iPhone vs iPad that makes form sheet be fullscreen, but horizontally compact vs horizontally regular size class .
实际上,iPhone和iPad并不能使表单成为全屏,而是横向紧凑而不是水平常规尺寸等级 。 Which means that form sheet is non-fullscreen on iPhone 6/6s Plus in landscape orientation, but not in portrait orientation or on other iPhone models.
这意味着表格在iPhone 6 / 6s Plus上是横向非全屏,但不是纵向或其他iPhone型号。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.