Zingxing 默认的就是一个扫描的小框框,但是就这一个小框框远远满足不了现在的需求那就需要我们自己写一个扫描的界面了
先看图
接下来就要下实现这个界面的代码了
首先先来看看布局是怎么写的吧
<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="com.example.erweima.CustomCapatrueActivity">
<FrameLayout
android:id="@+id/fl_zxing_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_weight="1"
android:id="@+id/flash_light"
android:gravity="center_horizontal"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:src="@mipmap/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:textColor="#ffffff"
android:text="闪光灯"
android:layout_width="wrap_content"
android:layout_heig