Android 为什么我会在视图中看到绿色部分
在我尝试了所有可能的方法来重叠我眼中的绿色部分之后,我仍然得到了这个小部分,我该如何摆脱它呢Android 为什么我会在视图中看到绿色部分,android,barcode-scanner,Android,Barcode Scanner,在我尝试了所有可能的方法来重叠我眼中的绿色部分之后,我仍然得到了这个小部分,我该如何摆脱它呢 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:id="@+id/barcode_scanner"
android:name="info.androidhive.barcode.BarcodeReader"
android:layout_width="350dp"
android:layout_height="300dp"
android:layout_centerInParent="true"
android:layout_margin="@dimen/activity_vertical_margin"
app:auto_focus="true"
app:use_flash="false" />
<info.androidhive.barcode.ScannerOverlay
android:id="@+id/b"
android:layout_width="350dp"
android:layout_height="300dp"
android:layout_centerInParent="true"
android:layout_margin="@dimen/activity_vertical_margin"
android:background="#916e6e6e"
app:line_color="#7323DC"
app:line_speed="6"
app:line_width="2"
app:square_height="450"
app:square_width="350" />
</RelativeLayout>
在您添加此xml和测试之前,我已解决了此问题:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<fragment
android:id="@+id/barcode_scanner"
android:name="info.androidhive.barcode.BarcodeReader"
android:layout_width="350dp"
android:layout_height="350dp"
android:layout_centerInParent="true"
app:auto_focus="true"
app:use_flash="false" />
<info.androidhive.barcode.ScannerOverlay
android:id="@+id/b"
android:layout_width="350dp"
android:layout_height="350dp"
android:layout_centerInParent="true"
android:background="#916e6e6e"
app:line_color="#7323DC"
app:line_speed="6"
app:line_width="4"
app:square_height="450"
app:square_width="350" />
</RelativeLayout>
快乐编码;) 许多用户都有同样的问题。请在这里查一下