相关疑难解决方法(0)

在Android Studio中使用ZXING更改QR扫描仪方向

我希望你能帮助我.我使用Zxing嵌入式库来使用QR扫描仪,问题是在横向模式下,我想将其更改为纵向.

我在Graddle的依赖项上有这个

compile 'com.journeyapps:zxing-android-embedded:2.0.1@aar'
compile 'com.journeyapps:zxing-android-integration:2.0.1@aar'
compile 'com.google.zxing:core:3.0.1'
Run Code Online (Sandbox Code Playgroud)

我在我的java类中有这个用按钮激活扫描仪...

public void scanQR(View view){
    IntentIntegrator integrator = new IntentIntegrator(this);
    integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
    integrator.setResultDisplayDuration(0);//Text..
    integrator.setPrompt(" Scan a QR Code");
    integrator.setScanningRectangle(450, 450);//size
    integrator.setCameraId(0);  // Use a specific camera of the device
    integrator.initiateScan();

}
Run Code Online (Sandbox Code Playgroud)

谢谢您的帮助!

camera android qr-code orientation zxing

5
推荐指数
2
解决办法
2万
查看次数

标签 统计

android ×1

camera ×1

orientation ×1

qr-code ×1

zxing ×1