📜  反应本机图像选择器相机 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:18.701000             🧑  作者: Mango

代码示例1
$ yarn add react-native-image-picker
...
let options: ImagePicker.CameraOptions = {
  saveToPhotos: true,
  mediaType: 'photo',
  cameraType: 'front'
};

ImagePicker.launchCamera(options, (response) => {
  if (response.assets) {
    console.log(response.assets);
  }
})