gpt4 book ai didi

iOS 方向在相机关闭后适应未经批准的设备方向

转载 作者:行者123 更新时间:2023-12-01 16:45:16 25 4
gpt4 key购买 nike

我目前正在编写一个 iOS 应用程序,其中可接受的设备方向设置为横向右和横向左,并且在我所有的 View Controller 中,我在 supportInterfaceOrientations 方法中只返回这两个。

但是,如果用户使用应用内相机功能(通过 UIImagePickerController 以全屏模式呈现)并将设备旋转到纵向拍摄照片,相机将旋转到纵向模式(这很好),并且如果用户单击“使用照片”,当模态视图被关闭时,启动相机的 View 现在以某种方式处于纵向模式(这不好)。

关闭相机 View 后,启动它的 View Controller 将 UIDeviceOrientationIsPortrait 设置为 true。我想知道它是如何以这个方向结束的,以及在拍摄照片时如何确保呈现 View Controller 保持横向。任何帮助是极大的赞赏!

最佳答案

I am currently writing an iOS app in which have the acceptable device orientations set to Landscape Right and Landscape Left, and in all of my view controllers, I’m returning only those two in the supportedInterfaceOrientations method.



在 iOS 6 及更高版本中,您的应用程序支持在应用程序的 Info.plist 文件中定义的界面方向

你试过在这里设置吗?然后看看问题是否仍然存在。

此外,如果这不起作用,请尝试设置 supportedInterfaceOrientations viewWillAppear 中的值 ViewController 的方法推出 UIImagePicker ?

关于iOS 方向在相机关闭后适应未经批准的设备方向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20498693/

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