zxing embedded - setCaptureActivity()导致活动不出现

时间:2015-11-05 16:38:21

标签: android orientation zxing

我尝试将zxing嵌入式扫描仪方向从横向更改为纵向。

我在ZE readme on github找到了一个如何做的例子。但行

integrator.setCaptureActivity(CaptureActivityAnyOrientation.class);

导致甚至不显示活动。没有线条,除了纵向方向外,它的效果很好。此代码适用于版本3及更高版本,我使用版本3.0.2。

有人有同样的问题吗?

1 个答案:

答案 0 :(得分:0)

更改方向

要更改方向,请在AndroidManifest.xml中指定方向,并让ManifestMerger更新活动的定义。

样品:

<activity
        android:name="com.journeyapps.barcodescanner.CaptureActivity"
        android:screenOrientation="fullSensor"
        tools:replace="screenOrientation" />

IntentIntegrator integrator = new IntentIntegrator(this);
integrator.setOrientationLocked(false);
integrator.initiateScan();