当应用程序的其余部分处于横向模式时,以纵向显示相机的一半 [英] Show Camera in half of the screen in portrait when rest of the application is in landscape mode

查看:142
本文介绍了当应用程序的其余部分处于横向模式时,以纵向显示相机的一半的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的iPad应用程序仅适用于横向模式。我想在屏幕的上半部分以纵向模式打开相机,而在下半部分我想添加一些IBOutlets。 projetc设置支持的界面方向的FYI仅横向左侧和横向右侧。

I have my application for iPad and its in landscape mode only . I want to open camera in portrait mode in upper half of the screen, and in the lower half i want to add some IBOutlets. FYI in projetc's setting supported interface orientations are Landscape left and landscape right only.

我尝试了链接仅在屏幕的一半显示相机,因为在didfinishPickingMediaWithInfo中我删除了imagePickerController.view

I tried the solution given on link Show camera on only half of the screen as it is and in didfinishPickingMediaWithInfo i removed the imagePickerController.view


  1. 相机全屏显示:(

  2. 如何以肖像方式打开相机。

  3. didfinishPickingMediaWithInfo在UIImagePickerControllerEditedImage中返回null。
    请帮助。


推荐答案

我认为你无法通过UIImagePickerController实现所需的行为,因为它是一种特殊的控制器。
您可以查看媒体捕获指南。然后您可以创建自己的AVCaptureVideoPreviewLayer大小并呈现它你喜欢的方式虽然你需要自己编写用于捕获图像的代码。

I think you won't be able to achieve desired behaviour with UIImagePickerController since it is a special kind of controller. You can take a look in media capture guide. You can then create AVCaptureVideoPreviewLayer with your own size and present it how you like though you will need to write your own code for capturing images.

这是Apple的文档。
http:// developer。 apple.com/library/mac/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/04_MediaCapture.html

This is the Apple doc for that. http://developer.apple.com/library/mac/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/04_MediaCapture.html

这是一个包含代码段的精彩演示文稿。
http:// www。 slideshare.net/invalidname/capturing-stills-sounds-and-scenes-with-av-foundation

This is a good presentation with code snippets. http://www.slideshare.net/invalidname/capturing-stills-sounds-and-scenes-with-av-foundation

您可能还会发现这个问题很有用。
AVCaptureVideoPreviewLayer方向 - 需要景观

You might also find this question useful. AVCaptureVideoPreviewLayer orientation - need landscape

这篇关于当应用程序的其余部分处于横向模式时,以纵向显示相机的一半的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆