我希望你能帮助我。我正在使用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'
我在Java类中有以下代码来使用按钮激活扫描器...
and I have this in my java class to activate the scanner with a button...
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();
}
谢谢您的帮助!