简体   繁体   English

ios4 中的相机活动问题

[英]Problem in camera activities in ios4

hi so far i have used UIImagePickerController for camera activities in IOS3.嗨,到目前为止,我已经在 IOS3 中使用 UIImagePickerController 进行相机活动。 But in IOS4 the ImagePickerController is not working properly.但在 IOS4 中,ImagePickerController 无法正常工作。 When i tried to capture image it shows either a white image or else the app gets crashed often.当我尝试捕获图像时,它要么显示白色图像,要么应用程序经常崩溃。

So i started using the AVCapture device for my camera activities.所以我开始使用 AVCapture 设备来进行我的相机活动。 In this too i started facing new problems.在这方面,我也开始面临新的问题。 When i capture the image in landscape the image preview shows the image to be portrait and vice versa.当我以横向拍摄图像时,图像预览将图像显示为纵向,反之亦然。 And some times it shows memory level warning.有时它会显示 memory 级别警告。

Both the UIImagePickerController and the AVCapture are making problems. UIImagePickerController 和 AVCapture 都存在问题。 I want to know how to solve these problems.我想知道如何解决这些问题。 Else is there any other way to handle camera activities in IOS4.还有其他方法可以处理 IOS4 中的相机活动。

Please help me friends.....请朋友们帮帮我......

If you just want to enable the user to take photos, UIImagePickerController is the way to go.如果你只是想让用户拍照,UIImagePickerController 是 go 的方式。 AVFoundation is quite low level and requires you to handle a lot of things yourself (eg compensating for the device orientation). AVFoundation 非常低级,需要您自己处理很多事情(例如补偿设备方向)。

I've used UIImagePickerController extensively on iOS 4 and it works just fine for me.我在 iOS 4 上广泛使用了 UIImagePickerController,它对我来说很好用。 I suspect the white image/crashing problems are due to something else in your code.我怀疑白色图像/崩溃问题是由于您的代码中的其他内容造成的。 If you post a few code snippets we can try to figure out what's going on.如果您发布一些代码片段,我们可以尝试找出发生了什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM