我有cordova应用程序,其中我使用zxing lib实现了条形码扫描仪。我创建了一个小活动,该活动显示了实时相机预览以进行条形码扫描。该活动实际上是通过单击html按钮在顶部html页面(cordova视图)上打开的。我在打开条形码视图时遇到问题,它阻止了html视图上的导航,并且在我关闭此条形码活动之前没有任何作用。我不明白这是为什么它阻止了顶视图,因为此活动仅位于底部。
此黑色部分和完成按钮是一个在蓝色HTML页面(cordova)顶部打开的android活动
这是代码条形码活动:
AndroidManifest.xml
<activity android:name=".activity.ContinousScanActivity"
android:launchMode="singleTask"
android:excludeFromRecents="true"
android:label="Scan Medicine"
android:theme="@style/MyTheme">
</activity>
style.xml:
<style name="MyTheme" parent="android:Theme.Holo.Dialog">
<item name="android:layout_width" >fill_parent</item>
<item name="android:layout_height" >wrap_content</item>
<item name="android:alertDialogStyle">@style/CustomAlertDialogStyle</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:textColorPrimary">#FFFFFF</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:textColor">#FFFFFF</item>
<item name="android:textStyle">normal</item>
<item name="android:textSize">12sp</item>
</style>
<style name="CustomAlertDialogStyle">
<item name="android:bottomBright">@android:color/transparent</item>
<item name="android:bottomDark">@android:color/transparent</item>
<item name="android:bottomMedium">@android:color/transparent</item>
<item name="android:centerBright">@android:color/transparent</item>
<item name="android:centerDark">@android:color/transparent</item>
<item name="android:centerMedium">@android:color/transparent</item>
<item name="android:fullBright">@android:color/transparent</item>
<item name="android:fullDark">@android:color/transparent</item>
<item name="android:topBright">@android:color/transparent</item>
<item name="android:topDark">@android:color/transparent</item>
</style>
ContinousScanActivity.java:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.continuous_scan);
WindowManager.LayoutParams params = getWindow().getAttributes();
params.x = 10;
params.height = 800;
params.width = 1050;
params.y = 500;
this.getWindow().setAttributes(params);
this.setFinishOnTouchOutside(false);
barcodeView = (DecoratedBarcodeView) findViewById(R.id.zxing_barcode_scanner);
Collection<BarcodeFormat> formats = Arrays.asList(BarcodeFormat.QR_CODE);
barcodeView.getBarcodeView().setDecoderFactory(new DefaultDecoderFactory(formats));
..
}
这两种视图有没有互相阻碍的工作方式?