是否可以在横向模式下在 iphone 中显示 UIImagePickerController? [英] Is it possible to show UIImagePickerController in iphone in landscape mode?
问题描述
我的应用程序是横向的.我正在使用 UIImagePickerController
录制 video
.但是每当我们调用 UIImagePickerController
时,它都会进入纵向模式.我决定使用UIImagePickerController`子类来旋转 imagep pickercontroller 的布局.
My application is in Landscape. I am using UIImagePickerController
to record a video
. But whenever we call the UIImagePickerController
, it is coming in portrait mode. I decided to rotate the layout of imagep pickercontroller by using
UIImagePickerController` Subclass.
通过这个,image picker controller
布局进入横向.但它仅适用于 iPad
.我在 iPhone 上测试过.但它不起作用.iPad
中的布局并没有完全改变.
Through this, image picker controller
layout is coming in Landscape. But it is working in iPad
only. I tested in iPhone. But it is not working. Layout is not changing exactly in iPad
.
是否可以在横向模式下在 iPhone 中显示 UIImagePickerController
?
Is it possible to show UIImagePickerController
in iPhone in landscape mode?
第一张图片是,我在 iPad 上测试过.第二个是,我在 iPhone 上测试过.
First picture is, I tested in iPad. Second one is, I tested in iPhone.
推荐答案
根据 UIImagePickerController 类文档 这是不可能的:
As per UIImagePickerController class documentation it is not possible:
重要提示:UIImagePickerController 类仅支持纵向模式.此类旨在按原样使用,不支持子类化.此类的视图层次结构是私有的,不得修改,只有一个例外.您可以为 cameraOverlayView 属性分配一个自定义视图,并使用该视图来显示附加信息或管理相机界面和您的代码之间的交互.
Important: The UIImagePickerController class supports portrait mode only. This class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified, with one exception. You can assign a custom view to the cameraOverlayView property and use that view to present additional information or manage the interactions between the camera interface and your code.
但是是的,您可以自定义此控制器以根据您的要求工作.我想如果你改变/替换 cameraOverlayView
(比如点击按钮和所有)到横向它会自动看起来像横向模式.
But yes you can customize this controller to work as per your requirement.
I think if you change/replace cameraOverlayView
(like click button and all) to landscape it'll automatically look like in landscape mode.
这篇关于是否可以在横向模式下在 iphone 中显示 UIImagePickerController?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!