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"
            }
         }
      }
    }

    添加功能实现代码:

  • 相关阅读:
    dubbo源码解析-spi(3)
    dubbo源码解析-spi(二)
    dubbo源码解析-spi(一)
    java-nio之zero copy深入分析
    Java SPI(Service Provider Interface)简介
    分析 Java heap dump工具之IBM HeapAnalyzer
    深入理解分布式事务
    NIO中的heap Buffer和direct Buffer区别
    Guava之Iterables使用示例
    Android开发中常见的设计模式 MD
  • 原文地址:https://www.cnblogs.com/fanlu/p/8986221.html
Copyright © 2011-2022 走看看