我希望你能帮助我.我使用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)
谢谢您的帮助!