为什么我在视图中看到绿色部分
Why am I getting a green part in the view
在尝试了所有可能的重叠视图中的绿色部分之后,我仍然得到了这个小部分,我该如何摆脱它?
<?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>
快乐编码;)
在尝试了所有可能的重叠视图中的绿色部分之后,我仍然得到了这个小部分,我该如何摆脱它?
<?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>
快乐编码;)