zoukankan      html  css  js  c++  java
  • ReactNative常用组件库 react-native-camera 相机

    通过react-native-camera调用原生相机,及自定义样式

    GitHub地址:

    https://github.com/react-native-community/react-native-camera

    安装:

    npm install react-native-camera --save
    react-native link react-native-camera

    配置:

    1.修改...androidappsrcmainAndroidManifest.xml,增加摄像头处理权限

    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    2.设置gradle版本,编辑 android/gradle/grade-wrapper.properties:

    distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists
    zipStoreBase=GRADLE_USER_HOME
    zipStorePath=wrapper/dists
    distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip

    3.修改android/build.gradle

    buildscript {
        repositories {
            jcenter()
            google()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.1.0'
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            mavenLocal()
            jcenter()
            google()
            maven { url "https://jitpack.io" }
            maven { url "https://maven.google.com" }
            maven {
                // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
                url "$rootDir/../node_modules/react-native/android"
            }
        }
    }
    
    subprojects {
      project.configurations.all {
         resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                  && !details.requested.name.contains('multidex') ) {
               details.useVersion "26.1.0"
            }
         }
      }
    }

    添加功能实现代码:

  • 相关阅读:
    过国内外的waf的一些奇淫绝技<转>
    杂七杂八的敏感文件注释<持续更新帖>
    [讨论]“传递式”的攻击思想<转LN>
    无线hacking集合贴,持续更新~
    dede找后台《转》
    开源MFC扩展界面库:Ultimate Toolbox的编译(转)
    【转】Windows环境下设置Tomcat6启动参数
    [转]关于dll文件的生成以及找不到jni.h的解决办法
    VBA 7788
    ODBC连接EXCEL的一些问题
  • 原文地址:https://www.cnblogs.com/fanlu/p/8986221.html
Copyright © 2011-2022 走看看