ios - 使用带有水平紧凑型 UITraitCollection 的自定义 UIPresentationController,否则使用弹出窗口

标签 ios uikit uipresentationcontroller

我有一个在通用 iOS 应用程序中呈现的 View Controller 。在 iPhone 上,它使用自定义 UIPresentationController 显示,该 Controller 使用 UIPresentationControllerframeOfPresentedViewInContainerView 方法调整呈现 View 的框架。这工作正常,但是......

在 iPad 上,当 UITraitCollection 具有 Regular 宽度时,我希望相同的 View Controller 显示为弹出窗口,但在紧凑 宽度。这可以实现吗?

最佳答案

这是不可能的。直接来自 Apple 的 "What's new in iOS8 guide"

With the amount of screen space available, the iPad has a regular size class in the vertical and horizontal directions in both portrait and landscape orientations.

enter image description here

关于ios - 使用带有水平紧凑型 UITraitCollection 的自定义 UIPresentationController,否则使用弹出窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37540890/

相关文章:

iphone - xcodebuild:模拟器还是设备?

ios - XIB 中设置的 UIButton 操作但未触发

ios8 - 当另一个 View Controller 显示在它上面时,UIPresentationController 会改变大小

ios - 为什么在呈现另一个 Controller 时 UIPresentationController 高度会发生变化?

ios - 没有动画的自定义 View Controller 演示

ios - 将多个 UILabel 放入一个数组中

ios - 如果我在结构中分离一个对象,在内存方面会发生什么

ios - 如何将 UITextView 的文本设置为粗体且不可点击

ios - 带 UIRefreshControl 的水平 UICollectionView

ios - 无法将网页添加到 UIViewController (Swift)