gpt4 book ai didi

iphone - isOrientationSupported 在 IOS 中已弃用

转载 作者:可可西里 更新时间:2023-11-01 03:02:43 25 4
gpt4 key购买 nike

我收到这个错误,我不知道如何修复它..

WARNING: -[<AVCaptureVideoPreviewLayer: 0xad482c0> isOrientationSupported] is deprecated.  Please use AVCaptureConnection's -isVideoOrientationSupported

然而当我看着苹果时documentation它说它是 Mac OS 功能..不是 IOS...所以我有点困惑...期待得到一些答案..谢谢..

最佳答案

一些示例代码也适用于 pre-6.0:

if ([captureVideoPreviewLayer respondsToSelector:@selector(connection)])
{
if ([captureVideoPreviewLayer.connection isVideoOrientationSupported])
{
[captureVideoPreviewLayer.connection setVideoOrientation:self.interfaceOrientation];
}
}
else
{
// Deprecated in 6.0; here for backward compatibility
if ([captureVideoPreviewLayer isOrientationSupported])
{
[captureVideoPreviewLayer setOrientation:self.interfaceOrientation];
}
}

关于iphone - isOrientationSupported 在 IOS 中已弃用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11532337/

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