我使用lib bellow制作qr扫描仪,我用按钮调用扫描。一切都好。我需要在捕获的底部中心添加一个自定义按钮。
lib:com.journeyapps:zxing-android-embedded:3.1.0@aar
我调用扫描仪的代码:
scannow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
IntentIntegrator scanIntegrator = new IntentIntegrator(MainActivity.this);
scanIntegrator.setPrompt("Scanning...");
scanIntegrator.setBeepEnabled(true);
scanIntegrator.setDesiredBarcodeFormats(IntentIntegrator.ALL_CODE_TYPES); scanIntegrator.setCaptureActivity(CaptureActivityAnyOrientation.class);
scanIntegrator.setOrientationLocked(true);
scanIntegrator.setBarcodeImageEnabled(true);
scanIntegrator.initiateScan();
}
});