【发布时间】:2017-11-03 02:31:30
【问题描述】:
我正在尝试在我的 NavigationStack 顶部添加一个摄像头捕获子视图,但即使代码根据调试运行良好,子视图也没有显示在顶部,因此我无法使用摄像头进行扫描
代码如下,为什么栈顶不显示?
- (IBAction)transactionListViewCameraBtn_Pressed:(id)sender {
if([NWTillHelper isDebug] == 1) {
NSLog(@"%s entered", __PRETTY_FUNCTION__);
}
NSLog(@"jongel1");
self.capture.delegate = self;
NSLog(@"jongel2");
[self applyOrientation];
NSLog(@"jongel3");
self.capture = [[ZXCapture alloc] init];
self.capture.camera = self.capture.back;
self.capture.focusMode = AVCaptureFocusModeContinuousAutoFocus;
NSLog(@"jongel4");
[self.view.layer addSublayer:self.capture.layer];
NSLog(@"jongel5");
[self.view bringSubviewToFront:self.scanRectView];
[self.view bringSubviewToFront:self.decodedLabel];
NSLog(@"jongel6");
}
【问题讨论】:
-
如何在初始化
self.capture之前为self.capture设置delegate? ;) -
BLEH 这就是我通宵工作得到的!!!!!!!当你按照正确的顺序做事时,现在睡觉就像一种魅力
-
我可以为您的问题添加答案吗? ;)
-
我当然马上接受
-
恭喜你,晚安;)
标签: ios objective-c addsubview