简体   繁体   English

在人像模式下使用ZXING的自定义相机视图。 Android的

[英]Custom Camera view using ZXING in Portrait Mode. Android

I am trying to use a custom barcode reader in portrait mode using Zxing library. 我正在尝试使用Zxing库以纵向模式使用自定义条形码阅读器。

It's easy to set orientation: https://github.com/journeyapps/zxing-android-embedded/issues/253 设置方向很容易: https : //github.com/journeyapps/zxing-android-embedded/issues/253

And I have seen you can customize a Camera Preview with minimal library: 我已经看到您可以使用最少的库来自定义Camera Preview:

https://medium.com/@marta/bar-code-scanner-in-android-with-custom-layout-zxing-2ab92d9d744c https://medium.com/@marta/bar-code-scanner-in-android-with-custom-layout-zxing-2ab92d9d744c

https://github.com/Promptus/zxing-android-minimal https://github.com/Promptus/zxing-android-minimal

Is there any way to use both? 有什么办法可以同时使用两者吗? or maybe other solution? 还是其他解决方案? Thank you! 谢谢!

You can use the BarcodeView of the Zxing Library in your own Activity. 您可以在自己的活动中使用Zxing库的BarcodeView。 This gives you the possibility to style the scanner and control the orientation. 这使您可以设置扫描仪样式并控制方向。

https://github.com/journeyapps/zxing-android-embedded/blob/master/zxing-android-embedded/src/com/journeyapps/barcodescanner/BarcodeView.java https://github.com/journeyapps/zxing-android-embedded/blob/master/zxing-android-embedded/src/com/journeyapps/barcodescanner/BarcodeView.java

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

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