zoukankan      html  css  js  c++  java
  • react-native 扫一扫功能(二维码扫描)功能开发

    1.安装插件

    yarn add react-native-smart-barcode

    2.关联

    react-native link react-native-smart-barcode

    3.修改 android/settings.gradle

    rootProject.name = 'Example'
    include ':react-native-smart-barcode'
    project(':react-native-smart-barcode').projectDir = new File(rootProject.projectDir, '../node_modules/react- 
    native-smart-barcode/android')
    
    include ':app'

    4.修改 android/app/build.gradle

    dependencies {
      compile project(':react-native-smart-barcode')
      ...
    }

    5.修改 android/app/src/main/AndroidManifest.xml

    <!-- smart-barcode所需权限 开始-->
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-feature android:name="android.hardware.camera" />
    <uses-feature android:name="android.hardware.camera.autofocus" />
    <!-- smart-barcode所需权限 结束-->

    6.修改 android/app/src/main/java/com/example/MainApplication.java

    import com.reactnativecomponent.barcode.RCTCapturePackage;
    
    new RCTCapturePackage(),

    .

  • 相关阅读:
    关于HTML5画布canvas的功能
    HTML5新标签介绍
    为HTML5添加新样式标签
    iOS开发相关图书推荐
    Android相关图书推荐
    C语言相关图书推荐
    C#相关图书推荐
    C++相关图书推荐
    JavaScript相关图书推荐
    Java相关书籍推荐
  • 原文地址:https://www.cnblogs.com/crazycode2/p/9493417.html
Copyright © 2011-2022 走看看