简体   繁体   English

如何在动作表中呈现动作扩展而不是全屏模态视图?

[英]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 . 我尝试过setPreferredContentSizeNSExtensionActionWantsFullScreenPresentation 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.

相关问题 如何在 SwiftUI 中全屏显示视图? - How to present a view full-screen in SwiftUI? 如何呈现动作表以模态呈现的View Controller? - How to present action sheet form a View Controller that present modally? 是否可以在全屏UICollectionViewCell上显示GADInterstitial? - Is it possible to present GADInterstitial on a full-screen UICollectionViewCell? 自动调整遮罩和全屏视图 - Autoresizing mask and full-screen view 如何在点击按钮时全屏显示.sheet() 以便将 go 显示到 SwiftUI 中的下一个视图? - How to present .sheet() full screen when a button is tapped in order for it to go to the next view in SwiftUI? Objective-C 如何从与当前视图重叠的标签栏中显示操作表? - Objective-C how to present an action sheet from tab bar that overlaps the current view? 如何创建一个 react-native 全屏模式,它将覆盖带有选项卡的 SafeAreaView? - How do I create a react-native full-screen modal that will cover a SafeAreaView with tabs? xCode-将关闭按钮添加到具有WebView的全屏模式吗? - xCode - Add close button to a full-screen modal with a WebView? 如何启用对滚动视图中存在的UIImageview的操作 - How to enable action on UIImageview present on Scroll view iOS 6 UIActivityViewController - 如何用本地语言呈现共享操作表? - iOS 6 UIActivityViewController - how to present Share Action Sheet with local language?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM