gpt4 book ai didi

iOS 外接显示器不填满屏幕

转载 作者:行者123 更新时间:2023-11-30 13:19:18 26 4
gpt4 key购买 nike

我的应用程序通过 Thunderbolt 转 HDMI 适配器在外部显示器上显示图像/视频。工作正常,但屏幕不填满。有某种边缘框架我不知道如何摆脱。它是相等的,大约50px,上,下,左,右..这是图像的代码:

func addImage(image: UIImage){
if UIScreen.screens().count > 1 {
let secondScreen = UIScreen.screens()[1]
secondWindow = UIWindow(frame: secondScreen.bounds)
print(secondScreen.bounds) // 1920x1080
//secondWindow?.layoutMargins = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) // Tried.. no change
secondWindow?.screen = secondScreen
secondScreenView = UIView(frame: secondWindow!.frame)
//secondScreenView?.layoutMargins = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) // Tried.. no change
secondWindow?.addSubview(secondScreenView!)
secondWindow?.hidden = false

externalImage = UIImageView(frame: secondScreen.bounds)

externalImage.contentMode = .ScaleAspectFit // Tried .ScaleAspectFill
externalImage.image = image

secondScreenView!.addSubview(externalImage)
}else{
noExternalDisplay()
}
}

最佳答案

找到答案了!!

secondScreen.overscanCompensation = UIScreenOverscanCompensation(rawValue: 3)!

关于iOS 外接显示器不填满屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37912915/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com