react native camera 使用

  1. 安装
    npm install --save react-native-camera@git+https://[email protected]/react-native-community/react-native-camera.git
    2.自动link
    react-native link react-native-camera
    3.ios配置权限
    info.plist里配置camera访问权限及提示信息
    4.安卓自动配置后有问题
    检查android/app/build.gradle:
android {
  ...
  defaultConfig {
    ...
    missingDimensionStrategy 'react-native-camera', 'general' <-- insert this line
  }
}

5.参考文章
(https://segmentfault.com/a/1190000014955481)
(https://github.com/react-native-community/react-native-camera)

你可能感兴趣的:(react native camera 使用)