二维码的自定义界面

本文介绍了如何在Zingxing基础上创建一个自定义的二维码扫描界面。内容包括界面设计、布局编写、扫描小框框的实现,以及使用Zxing库和处理权限的必要步骤。
摘要由CSDN通过智能技术生成

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
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值