附加 iPad 的外接显示器显示黑色填充

External Monitor attached with iPad shows black padding

我已使用下面 link 中的代码为我的 iPad 应用程序启用外部显示。

https://developer.apple.com/documentation/uikit/windows_and_screens/displaying_content_on_a_connected_screen

代码有效(即我们可以看到 viewcontroller 在外部显示器上呈现)。但是,四面八方都有黑色填充物,我无法弄清楚。我需要让它成为全屏体验。

在同一 iPad 上,照片应用连接到外接显示器时会显示全屏照片。

如有任何帮助,我们将不胜感激。

PS。我们已经在三台不同的显示器上进行了尝试。全高清和 4K。

您需要将第二个 UIScreen 实例上的 overscanCompensation 属性 设置为 .none