ZXing 展示带有导航控制器的 ZXingWidgetController
我对 ZXingWidgetController
有一个小问题,如果我使用导航控制器呈现控制器,视图将立即被推送,但是会有大约 1.5 秒的空白屏幕,然后 AVCapture开始。然而,如果我将其呈现为模态,则 AVCapture 会在模态呈现后立即启动。
我对 WidgetController
进行了相当多的篡改,因为我需要使用相同的 AVCapture
窗口读取其他类型的条形码,而且效果非常好。我虽然这可能是问题所在,但在尝试了未修改的 WidgetController 附带的 SampleTest 并将其推入导航控制器后,行为是相同的。所以这不是问题。
我尝试过延迟调用推送,但延迟后视图仍然被推送,并且首先出现空白屏幕。
有人处理过这个吗?
I have a small issue with the ZXingWidgetController
, if I present the controller using a navigation controller, the view will get pushed right away, however there will be a blank screen for about 1.5 seconds, and then the AVCapture starts. Yet if I present it as a modal, the AVCapture
starts as soon as the modal is presented.
I have tampered with the WidgetController
quite a bit, as I need to read other kinds of barcodes using the same AVCapture
window, and that is working perfectly fine. I though that might be the issue, but after trying the SampleTest that comes with the unmodified WidgetController, and pushing it in a nav controller the behavior is the same. So that is not the problem.
I have tried called the push with a delay, but after the delay the view is still pushed and a blank screen comes up first.
Has anyone dealt with this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你有一个演示可以展示这一点吗?
我想不出控制器的呈现方式有什么重要的原因。加载 AVFF 需要时间,因此第一次呈现某些内容时会花费更长的时间。 ZXWdidgetController 不保存 AVFF 对象:每当视图出现和消失时,它都会创建和删除它们。但是,无论小部件的呈现方式如何,所有这些事情都应该是相同的,只要比较首先与非第一即可。
一般来说,当 AVFF 启动相机时,捕获通常会短暂显示旧图像。据我所知,这对于所有与相机相关的应用程序来说都是如此(并且很乐意得到纠正)。但我认为它通常不会像 1500 毫秒那样。
请注意,在调试器下运行的延迟更加明显,可能是因为它在加载框架时加载符号等。
Do you have a demo that shows this?
I can't think of any reason it would matter how the controller is presented. It is the case that loading AVFF takes time so the first time you present something it takes longer. And the ZXWdidgetController doesn't save the AVFF objects: it creates and deletes them whenever the view appears and disappears. But all of these things should be the same regardless of the way the widget is presented as long as it's compared first vs non first.
In general, the capture usually shows an old image briefly while the AVFF starts the camera. This is pretty much true of all camera related apps as far as I know (and would be happy to be corrected.) But I don't think it's usually anything like 1500 ms.
Note that delays are even more pronounced running under the debugger, presumably because it's loading symbols etc as the framework is loaded.
今天回去工作,仔细看了一下代码...问题其实很简单,AVCapture start方法在viewDidAppear方法中被调用,我把它移到viewWillAppear方法中,问题解决了:)
Got back to work today, and looked closely at the code... the problem is actually very simple, the AVCapture start method is getting called in the viewDidAppear method, I moved it to the viewWillAppear method and problem solved :)