gpt4 book ai didi

ios - zbar - 扫描仪框架,如何使其横向显示

转载 作者:行者123 更新时间:2023-11-29 13:34:45 27 4
gpt4 key购买 nike

我在将相机/扫描仪设置为横向模式时遇到问题,即使我将屏幕更改为横向,但相机/扫描仪仍然显示为垂直。

我可以知道应该怎么做才能解决这个问题吗?在相机 API 上还是应该在 zbar 库上更改?

谢谢。

最佳答案

您必须为阅读器设置方向掩码:

reader.supportedOrientationsMask = ZBarOrientationMaskAll;

您可以在 ZBarReaderViewController 中编辑掩码:

// orientation set support
#define ZBarOrientationMask(orient) (1 << orient)
#define ZBarOrientationMaskAll \
(ZBarOrientationMask(UIInterfaceOrientationPortrait) | \
ZBarOrientationMask(UIInterfaceOrientationPortraitUpsideDown) | \
ZBarOrientationMask(UIInterfaceOrientationLandscapeLeft) | \
ZBarOrientationMask(UIInterfaceOrientationLandscapeRight))

关于ios - zbar - 扫描仪框架,如何使其横向显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10875754/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com