美文网首页React Native学习
react native 调用camera

react native 调用camera

作者: wanTag | 来源:发表于2018-07-18 14:16 被阅读4次

使用第三方插件

npm install react-native-camera
react-native link react-native-camera
android需要特殊注意的两处:

AndroidManifest.xml

 <!--获取相机权限-->
 <uses-permission android:name="android.permission.CAMERA"/>

 <uses-feature android:name="android.hardware.camera" android:required="false" />
 <uses-feature android:name="android.hardware.camera.front" android:required="false" />

android/build.gradle

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        google()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        maven { url "https://jitpack.io" }
        maven { url "https://maven.google.com" }
    }
}

相关文章

网友评论

    本文标题:react native 调用camera

    本文链接:https://www.haomeiwen.com/subject/aqpopftx.html