Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UIImageView方向应该向上,但始终是正确的_Ios_Swift_Uiimageview_Orientation_Landscape Portrait - Fatal编程技术网

Ios UIImageView方向应该向上,但始终是正确的

Ios UIImageView方向应该向上,但始终是正确的,ios,swift,uiimageview,orientation,landscape-portrait,Ios,Swift,Uiimageview,Orientation,Landscape Portrait,我已经将每个图像的imageOrientation更改为.up,如下代码所述: if (imageProcessed!.imageOrientation != .up){ print("imageProcessed != .up") UIGraphicsBeginImageContextWithOptions(imageProcessed!.size, false, imageProcessed!.scale) imageP

我已经将每个图像的imageOrientation更改为.up,如下代码所述:

if (imageProcessed!.imageOrientation != .up){
            print("imageProcessed != .up")
            UIGraphicsBeginImageContextWithOptions(imageProcessed!.size, false, imageProcessed!.scale)
            imageProcessed!.draw(in: CGRect(x:0, y:0, width: imageProcessed!.size.width, height: imageProcessed!.size.height))
            imageProcessed = UIGraphicsGetImageFromCurrentImageContext()!
            UIGraphicsEndImageContext()
            if(imageProcessed!.imageOrientation != .up){
                print("imageProcessed still != .up")
            }else if (imageProcessed!.imageOrientation == .up){
                print("imageProcessed == .up")
            }
        }

        circleView.contentMode = .scaleAspectFit
        circleView.image = imageProcessed
但是在
UIImageView
cameraView中,图片始终朝向landscapeRight,尽管它在print命令中表示imageOrientation向上

对我来说,
UIImageView
方向的定义似乎是设备的景观权等于。。。 我真的不明白为什么每张照片都是这样显示的

以下是一些例子:

此外,使用orientation Landscape Left拍摄的照片在imageView中显示为orientation Landscape Right

但是每一张有方向的图片都会从我的代码中得到方向

我想让所有的图片显示与方向“向上”或“肖像模式”,而不是景观权。你能告诉我怎么解决这个问题吗

提前谢谢大家