简体   繁体   English

UIImagePickerController上的相机按钮随机消失

[英]Camera button on UIImagePickerController is randomly disbled

I have a UIImagePickerController (source type camera) that I use to take pictures. 我有一个用于拍照的UIImagePickerController(源类型相机)。 I have it put properly in my .h (added the @property) and .m (@synthesize). 我把它正确地放在我的.h(添加了@property)和.m(@synthesize)中。 Here's what I use to show it: 这是我用来显示的内容:

if (thePicker == nil) {
thePicker = [[UIImagePickerController alloc] init];
thePicker.delegate = self;
thePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
thePicker.allowsEditing = NO;
}

[self presentModalViewController:thePicker animated:YES];

I'm having an odd problem. 我有一个奇怪的问题。 Every now and again, after closing/opening it a few times, the camera button OR the used button won't work (but the retake and cancel buttons work). 每次关闭/打开几次后,相机按钮或使用过的按钮将不起作用(但重新拍摄和取消按钮有效)。 I'm not getting any memory warnings and I have a dealloc and didReceiveMemoryWarnings void statement, but they don't get called. 我没有收到任何内存警告,我有一个dealloc和didReceiveMemoryWarnings void语句,但是没有被调用。

ANyone else having this problem? 还有其他人有这个问题吗?

I have seen some apps cover it up with their overlay, but you can't remove it. 我见过一些应用程序用其覆盖层覆盖它,但是您无法删除它。 AVCaptureSession really does sound more appropriate for your purposes. AVCaptureSession确实听起来更适合您的目的。 I see one example here: 我在这里看到一个例子:

http://www.musicalgeometry.com/?p=1273 http://www.musicalgeometry.com/?p=1273

Try this it may help ui guess Thanks!! 试试这个可能会帮助用户界面猜测谢谢!

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

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