Ios 我正在应用程序中使用Zxing库
我停止了相机,我使用下面的方法它的作品罚款Ios 我正在应用程序中使用Zxing库,ios,objective-c,ios8,zxing,Ios,Objective C,Ios8,Zxing,我停止了相机,我使用下面的方法它的作品罚款 - (void)viewDidLoad { self.capture = nil; self.capture = [[ZXCapture alloc] init]; self.capture.camera = self.capture.back; self.capture.focusMode = AVCaptureFocusModeContinuousAutoFocus;
- (void)viewDidLoad
{
self.capture = nil;
self.capture = [[ZXCapture alloc] init];
self.capture.camera = self.capture.back;
self.capture.focusMode = AVCaptureFocusModeContinuousAutoFocus;
self.capture.rotation = 90.0f;
self.capture.layer.frame = CGRectMake(0, 150, self.view.frame.size.width, self.view.frame.size.height);
self.capture.delegate = self;
[self.view.layer addSublayer:self.capture.layer];
[self.capture start];
}
我正在尝试启动相机,我使用以下方法
[self.capture stop];
上述方法不起作用,无法打开相机进行扫描
请帮忙
提前感谢。不要使用ZXing,iOS7支持条形码扫描()请移动开始方法视图。它似乎对我很好
[self.capture start];
stop方法的源代码已经过验证
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[self.capture start];
}
该层将从self.view.layer中删除,因此在开始方法中,再次添加该层,并将自定义视图放在前面
[self.layer removeFromSuperlayer];
您是否分配了多次?是否能够扫描PDF417格式的所有驾照?我在一个许可证上测试了它,效果很好。是的,你不需要导入一个库,它直接由苹果支持。
[self.view.layer addSublayer:self.capture.layer];
[self.view bringSubviewToFront:self.startButton];
[self.capture start];