第三方reactnativeimagepicker 选择图片上传

可以设置直接访问相机、相册,也可以弹出选择框进行选择

choosePicker = () => {
        const photoOptions = {
            title: "请选择",
            quality: 0.8,
            cancelButtonTitle: "取消",
            takePhotoButtonTitle: "拍照",
            chooseFromLibraryButtonTitle: "选择相册",
            allowsEditing: true,
            noData: false,
            storageOptions: {
                skipBackup: true,
                path: "images"
            }
        };
        ImagePicker.showImagePicker(photoOptions, response => {
            console.log("Response = ", response);
            const { avatarSource, imgAry } = this.state;
            console.log(avatarSource);
            if (response.didCancel) {
          
路是自己走出来的,而不是选出来的。
原文地址:https://www.cnblogs.com/mo3408/p/15741729.html