是否可以在 iOS 9 上让您的 iPad 应用退出多任务处理

Is it possible to opt your iPad app out of multitasking on iOS 9

我有一个大型应用程序,需要一些时间针对 iOS9 进行优化。

编辑:我担心的是当应用 window 大小减小时,所有 UI 都挤在一起。所以我的问题是,有什么方法可以强制应用程序全屏显示吗?

您必须修改项目以支持多任务处理。根据 WWDC 2015 video,要采用您的应用进行多任务处理,请满足以下要求:

  1. 使用 iOS 9 SDK
  2. 构建您的应用
  3. 支持所有方向
  4. 使用启动故事板

因此,如果其中任何一项尚未完成,您的应用将无法支持多任务处理。

当然,如果你不使用尺寸类,就把它放在列表的最前面。

编辑:根据你的问题编辑。 Info.plist 中有一个 UIRequiresFullScreen 键。在 Apple docs

查看更多

要选择退出幻灯片和拆分视图,请通过将 UIRequiresFullScreen 键添加到您的 Xcode 项目的 Info.plist 文件并应用布尔值 YES.

您可以使用目标的常规选项卡设置以上内容,Select需要全屏检查。参考下图相同

Note :

A user can disable Slide Over and Split View in Settings > General > Multitasking. If you think you’ve set up everything correctly and find that these features still don’t work, check this setting.

Adopting Multitasking Enhancements on iPad - Slide Over and Split View Quick Start

要为您的应用程序选择退出(禁用)多任务处理:

Select your TargetGeneral Section → Scroll Down and check Requires full screen

它应用于 plist 的 UIRequiresFullScreen 键值。

注意:如果应用支持多任​​务处理,则应用必须支持所有屏幕方向。否则,应用程序将在发布时出现以下错误:

Invalid Bundle. iPad Multitasking support requires these orientations: ...

仍然可以选择退出 iPad 多任务处理 — 但 Apple 在 WWDC 2019 上宣布,在 2020 年 4 月,所有 iPad 应用程序都需要支持多任务处理.

最初的公告和讨论也在 first few minutes of "Modernizing Your App for iOS 13", and there's a (brief) announcement on their developer-news site 中。